kamal213 Posted July 19, 2011 Share Posted July 19, 2011 Hi guys, I am not good with PHP and I need your help. I would like to create a confirmation page where you can confirm an action or cancel. Please help any way you can Thanks alot. Quote Link to comment Share on other sites More sharing options...
WebStyles Posted July 19, 2011 Share Posted July 19, 2011 in what situation? when submitting a form? if so, maybe you need a little javascript to avoid jumping back and forward between pages. Quote Link to comment Share on other sites More sharing options...
kamal213 Posted July 19, 2011 Author Share Posted July 19, 2011 Hi WebStyle, It is for a form correct. Do you know of any javascript codes that can help? Thanks Quote Link to comment Share on other sites More sharing options...
WebStyles Posted July 19, 2011 Share Posted July 19, 2011 you can use onsubmit="" to call a javascript function, and use a simple confirm("are you sure"); in javascript. Quote Link to comment Share on other sites More sharing options...
WebStyles Posted July 19, 2011 Share Posted July 19, 2011 A better example: function confirmSubmit(formName){ if(confirm("Are you sure you want to submit this form?")){ document.forms[formName].submit(); } } hope that helps Quote Link to comment Share on other sites More sharing options...
kamal213 Posted July 19, 2011 Author Share Posted July 19, 2011 It works like a charm Thanks WebStyles! So all I have2 to is when they click yes if redirects to a page else redirects to the previous page. Thanks for you help, really appreciate!!! 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.