lucerias Posted October 30, 2006 Share Posted October 30, 2006 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. Quote Link to comment Share on other sites More sharing options...
gmwebs Posted October 30, 2006 Share Posted October 30, 2006 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. Quote Link to comment Share on other sites More sharing options...
lucerias Posted October 30, 2006 Author Share Posted October 30, 2006 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. Quote Link to comment Share on other sites More sharing options...
gmwebs Posted October 30, 2006 Share Posted October 30, 2006 Can you post your code? Quote Link to comment Share on other sites More sharing options...
lucerias Posted October 30, 2006 Author Share Posted October 30, 2006 [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] Quote Link to comment Share on other sites More sharing options...
fenway Posted October 30, 2006 Share Posted October 30, 2006 Depending on how much you care, you could always use confirm(). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.