I have a checkbox at the bottom of my form which when checked unhides a <div> block which displays the submit button.
The problem I have is when the clear form button is pressed it removes the check but does not re-hide the submit <div> bit.
The way i see it, I have 3 options:
1) To simply remove the clear for button.
2) To exclude the said checkbox from the CLEAR button function.
3) To have the CLEAR button run an onlick to call the function which hides the submit button.
The latter would be my prefered. It sort of works in that the first click of the clear button clears the form, the second click calls the javascript which hides the <div> section.
This is the function which toggles the display:
Expand|Select|Wrap|Line Numbers
- <script>
- function toggle_display() {
- var form = document.getElementById('hidesubmit');
- var submit = document.getElementById('submit_group');
- ((form.checked)? submit.style.display='block': submit.style.display='none');
- }
- </script>
[HTML]<div id="submit_group" style="display:none;">
<table border="0" width="70%" id="table22" bgcolor="#CCFFFF">
<tr>
<td>
<p align="center"><font size="2">You may now click the SUBMIT button to
submit your e-Enrolment.</font><p align="center"><font size="2">When you click SUBMIT a screen will pop up indicating a program is sending an Email on your behalf.<br>
<b>You must click YES to submit the form.</b></font></td>
</tr>
</table>
<p>
<input type="Submit" value="Submit!">
</p>
</div>
<textarea rows="7" name="Authority" cols="30" style="width:753; font-weight:bold; height:116; font-family:Arial" wrap=virtual>ACCESS AUTHORISATION
I will tick the box to agree.....
</textarea><br>
<input type="checkbox" name="agreecheck" id="hidesubmit" value="Agreed" onClick="toggle_display();"/>
By placing a check in the box you are agreeing to the above Access Authorisation Statement.</font></b></p>
<input type="reset" onClick="toggle_display();" value="Clear Form"/>
<input type="hidden" name="EOR" value="">
</form>[/HTML]
Can I throw this open to suggests/comments...
Regards