Hello,
I'm still struggling with my brother's website, ever since MS upgraded IE. As a consequence of that update, the events "OnSubmit" and "Action" are no longer executed at the same time. The first click on the submit button triggers the "OnSubmit", which is a javascript; the second click triggers the "Action", which is a PHP sendmail script.
Here is what the form looks like:
The reason I want to keep the javascript: currently, a field is checked with it, and an error message is displayed in dynamic html (no popups). I would love to keep using this but ever since the IE patch, the first click only runs "CheckMyForm()", a function which simply calls all field-checking functions), the second click executes the post method.
How can I get these 2 calls back with one click of the submit button?
Can I call the post-method (sendmail.php) from CheckMyForm() ? If so, how?
Can I change the onblur event to something that might do the trick? To what?
I wanted to obmit the call to CheckMyForm (as the user will be directed to an error message using the php script anyway, as he click the submit button), but the function CheckMyForm also sets a variable with the form evaluation ("there were errors", or "there were no errors"). Based on this variable, the PHP script will send the mail, or direct to user to an error message.
The workaround to this would be to get rid of the variable and duplicate all the errorchecks in the PHP script, but there are quite a lot of them (including date checks, ...) and my PHP knowledge doesn't reach that far. Should I go that route?
I've been struggling with this for a few months, and can't seem to find a simple solution...
Jörg
I'm still struggling with my brother's website, ever since MS upgraded IE. As a consequence of that update, the events "OnSubmit" and "Action" are no longer executed at the same time. The first click on the submit button triggers the "OnSubmit", which is a javascript; the second click triggers the "Action", which is a PHP sendmail script.
Here is what the form looks like:
Code:
<form name="form1" onSubmit="CheckMyForm()" method="post" action="sendmail.php" > <table width="100%" border="0" align="center"> <tr><td width="30%" align="right">Naam:</td> <td align="left"><input type="text" name="naam" id="naam" size="40" maxlength="256" onblur="CheckField('naam')" > <div class="errormessage" id="e_naam"></div></td></tr> ...
How can I get these 2 calls back with one click of the submit button?
Can I call the post-method (sendmail.php) from CheckMyForm() ? If so, how?
Can I change the onblur event to something that might do the trick? To what?
I wanted to obmit the call to CheckMyForm (as the user will be directed to an error message using the php script anyway, as he click the submit button), but the function CheckMyForm also sets a variable with the form evaluation ("there were errors", or "there were no errors"). Based on this variable, the PHP script will send the mail, or direct to user to an error message.
The workaround to this would be to get rid of the variable and duplicate all the errorchecks in the PHP script, but there are quite a lot of them (including date checks, ...) and my PHP knowledge doesn't reach that far. Should I go that route?
I've been struggling with this for a few months, and can't seem to find a simple solution...
Jörg
Comment