Jump to content

Archived

This topic is now archived and is closed to further replies.

lucerias

Windows for Decision making

Recommended Posts

What is the code for popping up one windows and if user select "yes" then do some action, if "no" then nothing will happen? Thank you.

Share this post


Link to post
Share on other sites
Well if you are using a form, then you could do this...

[code]
<form action="../scripts/sitemaint.php" method="post" name="delgallery_form" onSubmit="return confirm('Are you sure? This will delete ALL photos contained in the gallery too...');">
[/code]

What will happen is that when the user clicks on the submit button, a window will pop up with the above message, and if the user clicks YES, then it will submit the form, if the user clicks NO, then nothing happens.

Share this post


Link to post
Share on other sites
It is not a form with HTML structure, it is merely a button created by PHP, and i need that button to trigger something, may i know how to do it, thank you.

Share this post


Link to post
Share on other sites
[code][$buttons = "<tr><td><input title='".$strings[EDIT_BUTTON_TITLE']."' accessKey='".$strings[EDIT_BUTTON_KEY']."' class='button' onclick=\"this.form.return_module.value='Customers'; this.form.return_action.value='NormalView'; this.form.return_id.value='$focus->id'; this.form.action.value='EditView'\" type='submit' name='Edit' value='  ".$strings['EDIT_BUTTON_LABEL']."  '></td></tr>\n";[/code]

Share this post


Link to post
Share on other sites
Depending on how much you care, you could always use confirm().

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.