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


Groups > comp.lang.php > #2844

Re: how to create (open) a dialog box

From sheldonlg <sheldonlg@thevillages.net>
Newsgroups comp.lang.php
Subject Re: how to create (open) a dialog box
Date 2011-08-16 16:02 -0400
Organization A noiseless patient Spider
Message-ID <j2eio6$mer$1@dont-email.me> (permalink)
References (1 earlier) <4e491384$0$5047$ba620e4c@news.skynet.be> <1goi4799ucaicoqa1qtjemjfjk10ob5i68@4ax.com> <j2cf6q$alc$1@dont-email.me> <5e58e$4e4a0c54$d9a28722$3705@news.hispeed.ch> <1533594.qVoOGUtdWV@PointedEars.de>

Show all headers | View raw


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

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

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

csiph-web