[thelist] javascript confirm dual submit nastiness

Anne-Marie a-m at ctsg.com
Fri Nov 22 18:35:01 CST 2002


Why don't you try this, it works in CF, no reason it shouldn't work with
php. Just replace #QueryName.Field# by the php notation and the action by
your file name.

<!--- Delete button --->
	<INPUT TYPE="Button" VALUE="Delete"
		onClick='if(confirm("Are you sure you would like to delete:
#QueryName.Field#?")) {
					this.form.action="file_delete.cfm";
					this.form.submit();}'>

I've got a form with TWO submit buttons - one is edit one is delete.
>Depending on which button is pressed, my php page either gives the
> user an edit form with the variable passed by the form filled in - or
> it simply deletes the item.
>
> Now, of course I want them to confirm the deletion. Here's the
> trouble. I can't use the onClick event handler since its a submit
> button. (Although I tried various ways to make this work, such as
> setting theform.submit = false while passing this.form, which
> failed).

Anne-Marie Feldman
Carol/Trevelyan Strategy Group
Phone: 541-302-3344
http://www.ctsg.com/





More information about the thelist mailing list