By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,813 Members | 1,253 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,813 IT Pros & Developers. It's quick & easy.

Questiion on "Are you sure"

P: n/a
I have a page that has three submit buttons. Depending upon which one
was clicked, I process it differently on the server in php. One of
those buttons is a delete action so I would like to add an "Are you
sure?" for that button. However, I don't want to do anything with the
other buttons.

I know how to do it if that were the only button ( onsubmit="return
validateAction()" ).
Aug 22 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
sheldonlg wrote on 22 aug 2008 in comp.lang.javascript:
I have a page that has three submit buttons. Depending upon which one
was clicked, I process it differently on the server in php. One of
those buttons is a delete action so I would like to add an "Are you
sure?" for that button. However, I don't want to do anything with the
other buttons.

I know how to do it if that were the only button ( onsubmit="return
validateAction()" ).
<input onclick = 'return .......'

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 22 '08 #2

P: n/a
sheldonlg wrote:
I have a page that has three submit buttons. *Depending upon which one
was clicked, I process it differently on the server in php. *One of
those buttons is a delete action so I would like to add an "Are you
sure?" for that button. *However, I don't want to do anything with the
other buttons.

I know how to do it if that were the only button ( onsubmit="return
validateAction()" ).
<input type="submit" name="action" value="Update">
<input type="submit" name="action" value="Delete"
onClick="if (!confirm('Sure ?')) return false;">

The 'name'-argument can be used to set the value of 'action' in PHP
(Delete or Update).

Hope this helps,

--
Bart
Aug 23 '08 #3

P: n/a
Bart Van der Donck wrote on 23 aug 2008 in comp.lang.javascript:
sheldonlg wrote:
>I have a page that has three submit buttons. *Depending upon which one
was clicked, I process it differently on the server in php. *One of
those buttons is a delete action so I would like to add an "Are you
sure?" for that button. *However, I don't want to do anything with the
other buttons.

I know how to do it if that were the only button ( onsubmit="return
validateAction()" ).

<input type="submit" name="action" value="Update">
<input type="submit" name="action" value="Delete"
onClick="if (!confirm('Sure ?')) return false;">
onClick = "return confirm('Sure ?');"
The 'name'-argument can be used to set the value of 'action' in PHP
(Delete or Update).


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Aug 23 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.