I've read a thousand threads about this topic, but they either don't apply to my exact problem, or I'm not smart enough to understand the answer. I'm OK at PHP, but I pretty much can only copy and past Javascript code. I think the solution is farily simple, I just don't know how to write the code. Here's my dilemma, simplified best I can:
The user is filling out a form with several fields. When they click 'Submit', a javascript looks at their selections and if certain criteria are met, a 'confirm' box pops up to ask them if they are sure they want to continue. If they click 'cancel', then nothing happens (so they can change their selections). If they click OK, then the contents of the form is sent to a new PHP page.
I need to know how to tell the next page that the 'confirm' box popped up, and (more importantly) that they clicked OK. Since the 'confirm' box on the previous page will only popup if certain requirements are met, it isn't a given that if the user gets to the next page that they saw the 'confirm' popup.
I'm thinking that a hidden form tag will work, but I haven't a clue where to put it or how to write it.
Here's a sample of the javascript for the 'confirm' popup box, which I just copied from somewhere and changed a little bit to work for my form:
function validate(theForm){
if (document.additional.method[0].checked && document.additional.finishdate.selectedIndex == 0)
{
ConfirmStatus = confirm("click OK if you're sure. or click cancel.")
if (ConfirmStatus == true) {return (true);}
if (ConfirmStatus == false) {return (false);}
}
}
So if they click OK, and the form passes the selections to the next page, I need to somehow tell my PHP code that they clicked OK.
Sorry to be such a rookie.
Thanks for the help.