Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #2798 > unrolled thread

how to create (open) a dialog box

Started byAndre <pas@pourmois.be>
First post2011-08-14 10:43 +0000
Last post2011-08-16 23:15 +0200
Articles 20 on this page of 28 — 8 participants

Back to article view | Back to comp.lang.php


Contents

  how to create (open) a dialog box Andre <pas@pourmois.be> - 2011-08-14 10:43 +0000
    Re: how to create (open) a dialog box Jerry Stuckle <jstucklex@attglobal.net> - 2011-08-14 09:13 -0400
    Re: how to create (open) a dialog box Robert Hairgrove <nobody@hogwash.com> - 2011-08-14 18:18 +0200
      Re: how to create (open) a dialog box Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-08-14 20:59 +0200
        Re: how to create (open) a dialog box Jerry Stuckle <jstucklex@attglobal.net> - 2011-08-15 08:48 -0400
          Re: how to create (open) a dialog box Tim Streater <timstreater@greenbee.net> - 2011-08-15 18:12 +0100
            Re: how to create (open) a dialog box Jerry Stuckle <jstucklex@attglobal.net> - 2011-08-15 13:31 -0400
              Re: how to create (open) a dialog box Tim Streater <timstreater@greenbee.net> - 2011-08-15 19:13 +0100
          Re: how to create (open) a dialog box Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-08-15 21:07 +0200
            Re: how to create (open) a dialog box Jerry Stuckle <jstucklex@attglobal.net> - 2011-08-15 17:19 -0400
              Re: how to create (open) a dialog box Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-08-16 18:47 +0200
                Re: how to create (open) a dialog box Jerry Stuckle <jstucklex@attglobal.net> - 2011-08-16 19:47 -0400
    Re: how to create (open) a dialog box Andre <pas@pourmois.be> - 2011-08-15 12:39 +0000
      Re: how to create (open) a dialog box A.Reader <anonymously@example.com> - 2011-08-15 14:18 -0400
        Re: how to create (open) a dialog box sheldonlg <sheldonlg@thevillages.net> - 2011-08-15 20:50 -0400
          Re: how to create (open) a dialog box Robert Hairgrove <nobody@hogwash.com> - 2011-08-16 08:21 +0200
            Re: how to create (open) a dialog box Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-08-16 19:03 +0200
              Re: how to create (open) a dialog box sheldonlg <sheldonlg@thevillages.net> - 2011-08-16 16:02 -0400
                Re: how to create (open) a dialog box Tim Streater <timstreater@greenbee.net> - 2011-08-16 21:13 +0100
                  Re: how to create (open) a dialog box Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-08-16 23:16 +0200
                    Re: how to create (open) a dialog box Tim Streater <timstreater@greenbee.net> - 2011-08-16 22:25 +0100
                      Re: how to create (open) a dialog box Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-08-17 20:31 +0200
                        Re: how to create (open) a dialog box Tim Streater <timstreater@greenbee.net> - 2011-08-17 21:50 +0100
                          Re: how to create (open) a dialog box sheldonlg <sheldonlg@thevillages.net> - 2011-08-17 21:06 -0400
                            Re: how to create (open) a dialog box Michael Fesser <netizen@gmx.de> - 2011-08-18 17:13 +0200
                              Re: how to create (open) a dialog box Tim Streater <timstreater@greenbee.net> - 2011-08-18 18:37 +0100
                Re: how to create (open) a dialog box Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-08-16 23:11 +0200
                  Re: how to create (open) a dialog box Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2011-08-16 23:15 +0200

Page 1 of 2  [1] 2  Next page →


#2798 — how to create (open) a dialog box

FromAndre <pas@pourmois.be>
Date2011-08-14 10:43 +0000
Subjecthow to create (open) a dialog box
Message-ID<4e47a6c9$0$5046$ba620e4c@news.skynet.be>
The problem is, I want to ask a user if he really want to delete a record 
from a database.
How to do this with a dialog box??
Many tanks in advances
Andre

[toc] | [next] | [standalone]


#2799

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-08-14 09:13 -0400
Message-ID<j28hln$be8$1@dont-email.me>
In reply to#2798
On 8/14/2011 6:43 AM, Andre wrote:
> The problem is, I want to ask a user if he really want to delete a record
> from a database.
> How to do this with a dialog box??
> Many tanks in advances
> Andre

PHP is server-side.  Dialog boxes are client-side.  You can't do it in PHP.

You can do it in javascript - try comp.lang.javascript.  You can even do 
something close in HTML, but it's much harder.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#2801

FromRobert Hairgrove <nobody@hogwash.com>
Date2011-08-14 18:18 +0200
Message-ID<b2b5e$4e47f54b$50daf0aa$2565@news.hispeed.ch>
In reply to#2798
On 08/14/2011 12:43 PM, Andre wrote:
> The problem is, I want to ask a user if he really want to delete a record
> from a database.
> How to do this with a dialog box??
> Many tanks in advances
> Andre

This is a job for JavaScript in your browser. PHP doesn't have dialog 
boxes because it runs on the server, not on the client.

[toc] | [prev] | [next] | [standalone]


#2802

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2011-08-14 20:59 +0200
Message-ID<1707830.mFDU7HY9l9@PointedEars.de>
In reply to#2801
Robert Hairgrove wrote:

> Andre wrote:
>> The problem is, I want to ask a user if he really want to delete a record
>> from a database.
>> How to do this with a dialog box??
> 
> This is a job for JavaScript in your browser.

Not necessarily.

> PHP doesn't have dialog boxes because it runs on the server, not on the
> client.

Wrong, but the question is probably off-topic here regardless.

<http://www.freeopenbook.com/phpcookbook/phpckbk-chp-20.html>


PointedEars
-- 
var bugRiddenCrashPronePieceOfJunk = (
    navigator.userAgent.indexOf('MSIE 5') != -1
    && navigator.userAgent.indexOf('Mac') != -1
)  // Plone, register_function.js:16

[toc] | [prev] | [next] | [standalone]


#2810

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-08-15 08:48 -0400
Message-ID<j2b4iv$agc$2@dont-email.me>
In reply to#2802
On 8/14/2011 2:59 PM, Thomas 'PointedEars' Lahn wrote:
> Robert Hairgrove wrote:
>
>> Andre wrote:
>>> The problem is, I want to ask a user if he really want to delete a record
>>> from a database.
>>> How to do this with a dialog box??
>>
>> This is a job for JavaScript in your browser.
>
> Not necessarily.
>
>> PHP doesn't have dialog boxes because it runs on the server, not on the
>> client.
>
> Wrong, but the question is probably off-topic here regardless.
>

Please identify which browsers implement PHP.  But you can't - because 
you're wrong - as usual.

> <http://www.freeopenbook.com/phpcookbook/phpckbk-chp-20.html>
>
>
> PointedEars



-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#2812

FromTim Streater <timstreater@greenbee.net>
Date2011-08-15 18:12 +0100
Message-ID<timstreater-A5B95B.18120615082011@news.individual.net>
In reply to#2810
In article <j2b4iv$agc$2@dont-email.me>,
 Jerry Stuckle <jstucklex@attglobal.net> wrote:

> On 8/14/2011 2:59 PM, Thomas 'PointedEars' Lahn wrote:
> > Robert Hairgrove wrote:
> >
> >> Andre wrote:
> >>> The problem is, I want to ask a user if he really want to delete a record
> >>> from a database.
> >>> How to do this with a dialog box??
> >>
> >> This is a job for JavaScript in your browser.
> >
> > Not necessarily.
> >
> >> PHP doesn't have dialog boxes because it runs on the server, not on the
> >> client.
> >
> > Wrong, but the question is probably off-topic here regardless.
> >
> 
> Please identify which browsers implement PHP.  But you can't - because 
> you're wrong - as usual.
> 
> > <http://www.freeopenbook.com/phpcookbook/phpckbk-chp-20.html>

Ah, the PHP-GTK stuff. I'd be happy if that worked well and was 
available. But it's more than a years since the website was even updated 
- and that was a comment a year after a comment that was itself a year 
after any software was last released. And that had nothing for OS X in 
which case <raspberry> to it.

So for all practical purposes PHP runs in the server, or possibly on 
your machine at the command line.

-- 
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689

[toc] | [prev] | [next] | [standalone]


#2813

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-08-15 13:31 -0400
Message-ID<j2bl6g$qlj$1@dont-email.me>
In reply to#2812
On 8/15/2011 1:12 PM, Tim Streater wrote:
> In article <j2b4iv$agc$2@dont-email.me>,
> Jerry Stuckle <jstucklex@attglobal.net> wrote:
>
>> On 8/14/2011 2:59 PM, Thomas 'PointedEars' Lahn wrote:
>> > Robert Hairgrove wrote:
>> >
>> >> Andre wrote:
>> >>> The problem is, I want to ask a user if he really want to delete a
>> record
>> >>> from a database.
>> >>> How to do this with a dialog box??
>> >>
>> >> This is a job for JavaScript in your browser.
>> >
>> > Not necessarily.
>> >
>> >> PHP doesn't have dialog boxes because it runs on the server, not on
>> the
>> >> client.
>> >
>> > Wrong, but the question is probably off-topic here regardless.
>> >
>>
>> Please identify which browsers implement PHP. But you can't - because
>> you're wrong - as usual.
>>
>> > <http://www.freeopenbook.com/phpcookbook/phpckbk-chp-20.html>
>
> Ah, the PHP-GTK stuff. I'd be happy if that worked well and was
> available. But it's more than a years since the website was even updated
> - and that was a comment a year after a comment that was itself a year
> after any software was last released. And that had nothing for OS X in
> which case <raspberry> to it.
>
> So for all practical purposes PHP runs in the server, or possibly on
> your machine at the command line.
>

Tim, GTK is not a browser.  I'd still like to see "Pointed Head" tell me 
which browsers implement PHP.

And please not I didn't indicate PHP can't run as a CLI on a client 
machine.  I specifically asked about browsers.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#2814

FromTim Streater <timstreater@greenbee.net>
Date2011-08-15 19:13 +0100
Message-ID<timstreater-127E99.19132815082011@news.individual.net>
In reply to#2813
In article <j2bl6g$qlj$1@dont-email.me>,
 Jerry Stuckle <jstucklex@attglobal.net> wrote:

> On 8/15/2011 1:12 PM, Tim Streater wrote:
> > In article <j2b4iv$agc$2@dont-email.me>,
> > Jerry Stuckle <jstucklex@attglobal.net> wrote:
> >
> >> On 8/14/2011 2:59 PM, Thomas 'PointedEars' Lahn wrote:
> >> > Robert Hairgrove wrote:
> >> >
> >> >> Andre wrote:
> >> >>> The problem is, I want to ask a user if he really want to delete a
> >> record
> >> >>> from a database.
> >> >>> How to do this with a dialog box??
> >> >>
> >> >> This is a job for JavaScript in your browser.
> >> >
> >> > Not necessarily.
> >> >
> >> >> PHP doesn't have dialog boxes because it runs on the server, not on
> >> the
> >> >> client.
> >> >
> >> > Wrong, but the question is probably off-topic here regardless.

> >> Please identify which browsers implement PHP. But you can't - because
> >> you're wrong - as usual.
> >>
> >> > <http://www.freeopenbook.com/phpcookbook/phpckbk-chp-20.html>
> >
> > Ah, the PHP-GTK stuff. I'd be happy if that worked well and was
> > available. But it's more than a years since the website was even updated
> > - and that was a comment a year after a comment that was itself a year
> > after any software was last released. And that had nothing for OS X in
> > which case <raspberry> to it.
> >
> > So for all practical purposes PHP runs in the server, or possibly on
> > your machine at the command line.

> Tim, GTK is not a browser.  I'd still like to see "Pointed Head" tell me 
> which browsers implement PHP.
> 
> And please note I didn't indicate PHP can't run as a CLI on a client 
> machine.  I specifically asked about browsers.

:-)

Indeed. I just came in at the end.

-- 
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689

[toc] | [prev] | [next] | [standalone]


#2817

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2011-08-15 21:07 +0200
Message-ID<2985676.SPkdTlGXAF@PointedEars.de>
In reply to#2810
Jerry Stuckle wrote:

> On 8/14/2011 2:59 PM, Thomas 'PointedEars' Lahn wrote:
>> Robert Hairgrove wrote:
>>> PHP doesn't have dialog boxes because it runs on the server, not on the
>>> client.
>> Wrong, but the question is probably off-topic here regardless.
> 
> Please identify which browsers implement PHP

Fallacy: Raising the bar.

> But you can't - because you're wrong - as usual.

Fallacy: Argumentum ad hominem.

>> <http://www.freeopenbook.com/phpcookbook/phpckbk-chp-20.html>

You haven't read that, have you?


PointedEars
-- 
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
  -- Richard Cornford, cljs, <f806at$ail$1$8300dec7@news.demon.co.uk>

[toc] | [prev] | [next] | [standalone]


#2818

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-08-15 17:19 -0400
Message-ID<j2c2h1$oiu$2@dont-email.me>
In reply to#2817
On 8/15/2011 3:07 PM, Thomas 'PointedEars' Lahn wrote:
> Jerry Stuckle wrote:
>
>> On 8/14/2011 2:59 PM, Thomas 'PointedEars' Lahn wrote:
>>> Robert Hairgrove wrote:
>>>> PHP doesn't have dialog boxes because it runs on the server, not on the
>>>> client.
>>> Wrong, but the question is probably off-topic here regardless.
>>
>> Please identify which browsers implement PHP
>
> Fallacy: Raising the bar.
>

Not at all.  We are talking client-server here.

>> But you can't - because you're wrong - as usual.
>
> Fallacy: Argumentum ad hominem.
>

Nope, the truth.

>>> <http://www.freeopenbook.com/phpcookbook/phpckbk-chp-20.html>
>
> You haven't read that, have you?
>
>
> PointedEars

Don't need to.  Unlike you, I know what I'm talking about.  But that's 
normal for you - your trolling has made you persona non grata in several 
newsgroups.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#2841

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2011-08-16 18:47 +0200
Message-ID<2982962.SPkdTlGXAF@PointedEars.de>
In reply to#2818
Jerry Stuckle wrote:

> On 8/15/2011 3:07 PM, Thomas 'PointedEars' Lahn wrote:
>> Jerry Stuckle wrote:
>>> On 8/14/2011 2:59 PM, Thomas 'PointedEars' Lahn wrote:
>>>> Robert Hairgrove wrote:
>>>>> PHP doesn't have dialog boxes because it runs on the server, not on
>>>>> the client.
>>>> Wrong, but the question is probably off-topic here regardless.
>>> Please identify which browsers implement PHP
>>
>> Fallacy: Raising the bar.
> 
> Not at all.  We are talking client-server here.

There is exactly nothing in the OP to suggest that.  In fact, it might very 
well be possible that the OP was indeed working on client-side code.  You 
might also want to notice that they were grateful especially for that link:
 
>>>> <http://www.freeopenbook.com/phpcookbook/phpckbk-chp-20.html>
>>
>> You haven't read that, have you?
> 
> Don't need to.  Unlike you, I know what I'm talking about.

No, you don't.  You are assuming things and you think that your assumptions 
are the only viable interpretation.  They are not.

> [ad hominem]

You can't help it, yes?


POintedEars
-- 
Use any version of Microsoft Frontpage to create your site.
(This won't prevent people from viewing your source, but no one
will want to steal it.)
  -- from <http://www.vortex-webdesign.com/help/hidesource.htm> (404-comp.)

[toc] | [prev] | [next] | [standalone]


#2861

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-08-16 19:47 -0400
Message-ID<j2evjc$dc5$1@dont-email.me>
In reply to#2841
On 8/16/2011 12:47 PM, Thomas 'PointedEars' Lahn wrote:
> Jerry Stuckle wrote:
>
>> On 8/15/2011 3:07 PM, Thomas 'PointedEars' Lahn wrote:
>>> Jerry Stuckle wrote:
>>>> On 8/14/2011 2:59 PM, Thomas 'PointedEars' Lahn wrote:
>>>>> Robert Hairgrove wrote:
>>>>>> PHP doesn't have dialog boxes because it runs on the server, not on
>>>>>> the client.
>>>>> Wrong, but the question is probably off-topic here regardless.
>>>> Please identify which browsers implement PHP
>>>
>>> Fallacy: Raising the bar.
>>
>> Not at all.  We are talking client-server here.
>
> There is exactly nothing in the OP to suggest that.  In fact, it might very
> well be possible that the OP was indeed working on client-side code.  You
> might also want to notice that they were grateful especially for that link:
>

That is hilarious (it means "very funny").  Everyone else who answered 
the question understood that.  But not "Pointed Head".

>>>>> <http://www.freeopenbook.com/phpcookbook/phpckbk-chp-20.html>
>>>
>>> You haven't read that, have you?
>>
>> Don't need to.  Unlike you, I know what I'm talking about.
>
> No, you don't.  You are assuming things and you think that your assumptions
> are the only viable interpretation.  They are not.
>
>> [ad hominem]
>
> You can't help it, yes?
>
>
> POintedEars

Just calling a spade a spade.  Or, in your case, calling a stoopid troll 
a stoopid troll - just like you've been called in so many newsgroups.


-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#2808

FromAndre <pas@pourmois.be>
Date2011-08-15 12:39 +0000
Message-ID<4e491384$0$5047$ba620e4c@news.skynet.be>
In reply to#2798
Le Sun, 14 Aug 2011 10:43:21 +0000, Andre a écrit :

> The problem is, I want to ask a user if he really want to delete a
> record from a database.
> How to do this with a dialog box??
> Many tanks in advances
> Andre

Many thanks to every body.
Very instersting, particalary the freebook site.
Andre

[toc] | [prev] | [next] | [standalone]


#2816

FromA.Reader <anonymously@example.com>
Date2011-08-15 14:18 -0400
Message-ID<1goi4799ucaicoqa1qtjemjfjk10ob5i68@4ax.com>
In reply to#2808
On 15 Aug 2011 12:39:32 GMT,
Andre <pas@pourmois.be> wrote:

>Le Sun, 14 Aug 2011 10:43:21 +0000, Andre a écrit :
>
>> The problem is, I want to ask a user if he really want to delete a
>> record from a database.
>> How to do this with a dialog box??
>> Many tanks in advances
>> Andre
>
>Many thanks to every body.
>Very instersting, particalary the freebook site.
>Andre

Andre, one way to avoid having to ask whether the person wants to
delete the record is to make deleting it a 2- or 3-action
process.  

For example, you might require that they check 2 checkboxes and
click a button.  A person might accidently check one box and
click the button, but it's quite unlikely that they'll check
_both_  boxes for the same record by mistake.

[toc] | [prev] | [next] | [standalone]


#2819

Fromsheldonlg <sheldonlg@thevillages.net>
Date2011-08-15 20:50 -0400
Message-ID<j2cf6q$alc$1@dont-email.me>
In reply to#2816
On 8/15/2011 2:18 PM, A.Reader wrote:
> On 15 Aug 2011 12:39:32 GMT,
> Andre<pas@pourmois.be>  wrote:
>
>> Le Sun, 14 Aug 2011 10:43:21 +0000, Andre a écrit :
>>
>>> The problem is, I want to ask a user if he really want to delete a
>>> record from a database.
>>> How to do this with a dialog box??
>>> Many tanks in advances
>>> Andre
>>
>> Many thanks to every body.
>> Very instersting, particalary the freebook site.
>> Andre
>
> Andre, one way to avoid having to ask whether the person wants to
> delete the record is to make deleting it a 2- or 3-action
> process.
>
> For example, you might require that they check 2 checkboxes and
> click a button.  A person might accidently check one box and
> click the button, but it's quite unlikely that they'll check
> _both_  boxes for the same record by mistake.

....or simply use an onClick to have a confirm message box pop up.

-- 
Shelly

[toc] | [prev] | [next] | [standalone]


#2824

FromRobert Hairgrove <nobody@hogwash.com>
Date2011-08-16 08:21 +0200
Message-ID<5e58e$4e4a0c54$d9a28722$3705@news.hispeed.ch>
In reply to#2819
On 08/16/2011 02:50 AM, sheldonlg wrote:
> On 8/15/2011 2:18 PM, A.Reader wrote:
>> On 15 Aug 2011 12:39:32 GMT,
>> Andre<pas@pourmois.be> wrote:
>>
>>> Le Sun, 14 Aug 2011 10:43:21 +0000, Andre a écrit :
>>>
>>>> The problem is, I want to ask a user if he really want to delete a
>>>> record from a database.
>>>> How to do this with a dialog box??
>>>> Many tanks in advances
>>>> Andre
>>>
>>> Many thanks to every body.
>>> Very instersting, particalary the freebook site.
>>> Andre
>>
>> Andre, one way to avoid having to ask whether the person wants to
>> delete the record is to make deleting it a 2- or 3-action
>> process.
>>
>> For example, you might require that they check 2 checkboxes and
>> click a button. A person might accidently check one box and
>> click the button, but it's quite unlikely that they'll check
>> _both_ boxes for the same record by mistake.
>
> ....or simply use an onClick to have a confirm message box pop up.
>

Exactly! And this is done in web applications using a client scripting 
language (such as JavaScript, not PHP).

Whether or not PHP can run on the client in specialized environments is 
irrelevant. In most cases, it does run on the server and cannot generate 
confirmation dialog boxes.

[toc] | [prev] | [next] | [standalone]


#2842

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2011-08-16 19:03 +0200
Message-ID<1533594.qVoOGUtdWV@PointedEars.de>
In reply to#2824
Robert Hairgrove wrote:

> On 08/16/2011 02:50 AM, sheldonlg wrote:
>> On 8/15/2011 2:18 PM, A.Reader wrote:
>>> Andre, one way to avoid having to ask whether the person wants to
>>> delete the record is to make deleting it a 2- or 3-action
>>> process.
>>>
>>> For example, you might require that they check 2 checkboxes and
>>> click a button. A person might accidently check one box and
>>> click the button, but it's quite unlikely that they'll check
>>> _both_ boxes for the same record by mistake.
>>
>> ....or simply use an onClick to have a confirm message box pop up.

For the reasons detailed below, `onClick' (or `onclick' in XHTML) is the 
wrong event-handler attribute (and `click' is the wrong event) to use here.

> Exactly! And this is done in web applications using a client scripting
> language (such as JavaScript, not PHP).

You are still wrong about which language can be used where, and you really 
do not know what JavaScript is.

However, more important to notice is that the drawback of a client-side only 
solution in the client-server model – assuming this is the case here – is 
that – rather obviously – it does not work without client-side support.  
There is the NoScript extension, for example, to prevent client-side scripts 
from running, as many people have used client-side scripting for rather 
dubious purposes.

The client-side dialog – in fact, any client-side code – should augment a 
server-side generated solution (to reduce the number of roundtrips to the 
server, thus enhancing user experience and reducing server/network load);
with few exceptions, it should not replace it.  This can be done easily, for 
example:

  <form action="delete-dialog.php"
        onsubmit="return window.confirm('Delete?')">
    <input type="submit" value="Delete">
  </form>

The best solution regarding this approach is a server-side framework which 
provides the classes to generate the forms (here: both for submitting the 
deletion request and confirming it) and the client-side code, so that the 
data only needs to be maintained in one place.
 

PointedEars
-- 
    realism:    HTML 4.01 Strict
    evangelism: XHTML 1.0 Strict
    madness:    XHTML 1.1 as application/xhtml+xml
                                                    -- Bjoern Hoehrmann

[toc] | [prev] | [next] | [standalone]


#2844

Fromsheldonlg <sheldonlg@thevillages.net>
Date2011-08-16 16:02 -0400
Message-ID<j2eio6$mer$1@dont-email.me>
In reply to#2842
On 8/16/2011 1:03 PM, Thomas 'PointedEars' Lahn wrote:
> Robert Hairgrove wrote:
>
>> On 08/16/2011 02:50 AM, sheldonlg wrote:
>>> On 8/15/2011 2:18 PM, A.Reader wrote:
>>>> Andre, one way to avoid having to ask whether the person wants to
>>>> delete the record is to make deleting it a 2- or 3-action
>>>> process.
>>>>
>>>> For example, you might require that they check 2 checkboxes and
>>>> click a button. A person might accidently check one box and
>>>> click the button, but it's quite unlikely that they'll check
>>>> _both_ boxes for the same record by mistake.
>>>
>>> ....or simply use an onClick to have a confirm message box pop up.
>
> For the reasons detailed below, `onClick' (or `onclick' in XHTML) is the
> wrong event-handler attribute (and `click' is the wrong event) to use here.
>
>> Exactly! And this is done in web applications using a client scripting
>> language (such as JavaScript, not PHP).
>
> You are still wrong about which language can be used where, and you really
> do not know what JavaScript is.
>
> However, more important to notice is that the drawback of a client-side only
> solution in the client-server model – assuming this is the case here – is
> that – rather obviously – it does not work without client-side support.
> There is the NoScript extension, for example, to prevent client-side scripts
> from running, as many people have used client-side scripting for rather
> dubious purposes.
>
> The client-side dialog – in fact, any client-side code – should augment a
> server-side generated solution (to reduce the number of roundtrips to the
> server, thus enhancing user experience and reducing server/network load);
> with few exceptions, it should not replace it.  This can be done easily, for
> example:
>
>    <form action="delete-dialog.php"
>          onsubmit="return window.confirm('Delete?')">
>      <input type="submit" value="Delete">
>    </form>
>
> The best solution regarding this approach is a server-side framework which
> provides the classes to generate the forms (here: both for submitting the
> deletion request and confirming it) and the client-side code, so that the
> data only needs to be maintained in one place.
>
>
> PointedEars

Wouldn't you use onsubmit only if you are submitting the entire page? 
The onclick allows you to confirm the deletion, send off an AJAX 
request, and still stay on the page.

-- 
Shelly

[toc] | [prev] | [next] | [standalone]


#2845

FromTim Streater <timstreater@greenbee.net>
Date2011-08-16 21:13 +0100
Message-ID<timstreater-A57E4A.21132016082011@news.individual.net>
In reply to#2844
In article <j2eio6$mer$1@dont-email.me>,
 sheldonlg <sheldonlg@thevillages.net> wrote:

> Wouldn't you use onsubmit only if you are submitting the entire page? 
> The onclick allows you to confirm the deletion, send off an AJAX 
> request, and still stay on the page.

Yes. In my app I never submit any forms at all. Everything happens via 
onclick events and ajax.

-- 
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689

[toc] | [prev] | [next] | [standalone]


#2852

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2011-08-16 23:16 +0200
Message-ID<4033706.4JQzZI6eRS@PointedEars.de>
In reply to#2845
Tim Streater wrote:

> sheldonlg <sheldonlg@thevillages.net> wrote:
>> Wouldn't you use onsubmit only if you are submitting the entire page?
>> The onclick allows you to confirm the deletion, send off an AJAX
>> request, and still stay on the page.
> 
> Yes. In my app I never submit any forms at all. Everything happens via
> onclick events and ajax.

IOW, your app cannot be used without client-side scripting, as "ajax" 
requires that.  With few exceptions, I would consider that bad software 
design.


PointedEars
-- 
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
  -- Richard Cornford, cljs, <f806at$ail$1$8300dec7@news.demon.co.uk>

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.php


csiph-web