Quack
asked on
Cold Fusion form reset button issues.
I have a CF form which is having issues w/ the reset button:
<form action="central_inv_contr_ verify.cfm " method="post" id="registerForm" onreset="resetForm(this);" >
Button code: <input type="reset" name="Reset" value="Reset" />
The button works fine to reset the form fields while on the page...however after you submit and go to the verify page and come back to edit the page the reset button isn't working...Any ideas. I can add more information but not sure what else would be pertinent.
<form action="central_inv_contr_
Button code: <input type="reset" name="Reset" value="Reset" />
The button works fine to reset the form fields while on the page...however after you submit and go to the verify page and come back to edit the page the reset button isn't working...Any ideas. I can add more information but not sure what else would be pertinent.
Do you any error, any console message anything you can share,
ASKER
That's what's odd...nothing in the error log...it's as if after you return to the page the button just does nothing...no error thrown...works the verify...then go back to edit and the reset is dead
ASKER
Ok...I think it has something to do w/ the hidden field added to keep the fields repopulated when returning to the form page from the verify page.
Here's the code used to keep the field populated and then the structure for the verify and reset buttons:
example fields:
<tr>
<td >
<font face="Arial" size="2" color="#990000">
<label for="Contact_Phone_Number" >Phone:&nb sp;</label >
<input type="text" name="Contact_Phone_Number " id="Contact_Phone_Number" min="0" step="1" minlength="10" maxlength="13" tabindex="20" value="<cfif structkeyexists(session.in voiceDataC ontr, "PASS")><cfoutput>#session .invoiceDa taContr.Co ntact_Phon e_Number#< /cfoutput> <cfelse><c foutput>#f orm.Contac t_Phone_Nu mber#</cfo utput></cf if>" required>
<font size="1" color="navy" title="Enter POC Phone, between 10 and 13 numbers without special characters.">
(help)
</font>
</font>
<font face="Arial, Helvetica, sans-serif" size="2" color="navy">
<label for="Contact_Fax_Number">F ax: < /label>
<input type="text" name="Contact_Fax_Number" min="0" step="1" id="Contact_Fax_Number" minlength="10" tabindex="21" maxlength="13" value="<cfif structkeyexists(session.in voiceDataC ontr, "PASS")><cfoutput>#session .invoiceDa taContr.Co ntact_Fax_ Number#</c foutput><c felse><cfo utput>#for m.Contact_ Fax_Number #</cfoutpu t></cfif>" >
<font size="1" color="navy" title="Enter POC Fax, between 10 and 13 numbers without special characters.">
(help)
</font>
</font>
</td>
</tr>
<tr>
<td align="center" bordercolor="#333399" style="border-left:thin #333399 solid; border-bottom:thin #333399 solid; border-right:thin #333399 solid">
<font face="Arial, Helvetica, sans-serif" size="2"><br/>
<input type="hidden" name="pass" value="pass" />
<input type="submit" name="Submit" value="Verify" />
<input type="reset" name="Reset" value="Reset" />
<cfflush interval="100">
<br />
<br />
</font>
</td>
This has recently been added fyi to the form so the problem resides in this I'm fairly sure but I don't understand why its not working when you go back to the page but works fine before hitting the verify button to go to the verification page.
Here's the code used to keep the field populated and then the structure for the verify and reset buttons:
example fields:
<tr>
<td >
<font face="Arial" size="2" color="#990000">
<label for="Contact_Phone_Number"
<input type="text" name="Contact_Phone_Number
<font size="1" color="navy" title="Enter POC Phone, between 10 and 13 numbers without special characters.">
(help)
</font>
</font>
<font face="Arial, Helvetica, sans-serif" size="2" color="navy">
<label for="Contact_Fax_Number">F
<input type="text" name="Contact_Fax_Number" min="0" step="1" id="Contact_Fax_Number" minlength="10" tabindex="21" maxlength="13" value="<cfif structkeyexists(session.in
<font size="1" color="navy" title="Enter POC Fax, between 10 and 13 numbers without special characters.">
(help)
</font>
</font>
</td>
</tr>
<tr>
<td align="center" bordercolor="#333399" style="border-left:thin #333399 solid; border-bottom:thin #333399 solid; border-right:thin #333399 solid">
<font face="Arial, Helvetica, sans-serif" size="2"><br/>
<input type="hidden" name="pass" value="pass" />
<input type="submit" name="Submit" value="Verify" />
<input type="reset" name="Reset" value="Reset" />
<cfflush interval="100">
<br />
<br />
</font>
</td>
This has recently been added fyi to the form so the problem resides in this I'm fairly sure but I don't understand why its not working when you go back to the page but works fine before hitting the verify button to go to the verification page.
however after you submit and go to the verify page and come back to edit the page the reset button isn't working
why do you need: onreset="resetForm(this);"
ASKER
I'm not sure...what should it be?
try remove the onreset="resetForm(this);" from your page and see what will happen ?
ASKER
same thing...reset button doesn't work
ASKER
new.txtold.txt
The two files attached are txt version of the cfm files guys...The older version was working correctly but after adding server side validation to the verification page the reset button is having issues. The newer version was modified to keep the text in the form fields when returning to the contribution page to edit the file. Any ideas on what's affecting the reset button functionality would be greatly appreciated. It works fine until you return to edit the form from the verify page then it dies.
The two files attached are txt version of the cfm files guys...The older version was working correctly but after adding server side validation to the verification page the reset button is having issues. The newer version was modified to keep the text in the form fields when returning to the contribution page to edit the file. Any ideas on what's affecting the reset button functionality would be greatly appreciated. It works fine until you return to edit the form from the verify page then it dies.
can you try to open the JS/JavaScript section of Inspect Element of your web browser and check if there's any error when you clicked the Reset button there?
ASKER
returns this:
The value of the property 'resetForm' is null or undefined, not a Function object
The value of the property 'resetForm' is null or undefined, not a Function object
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.