Show/Hide onclick and onload
Hi,
I have a form with yes/no radio groups and a corresponding text box relating to the individual radio groups. Basically, if no is selected then the text box does not appear and if yes is selected the text box does appear. This part is working fine. What I need now is for editing purposes for when the page loads it will also show the text box and its contents. As it is now when I pull up any records at a later time the yes is selected but the text box is not visible unless I click no and then yes again. What I need is to have the text area show if it is applicable. The onclick event works but I dont know how to get the onload to work, if that would be the correct way of doing it. TIA.
Here is what I have at the moment.
<script type = "text/javascript">
<!--
function hide(x) {
document.getElementById(x).style.visibility="hidden";
}
function show(x) {
document.getElementById(x).style.visibility="visible";
}
//-->
</script>
<cfinput type="radio" id="sendbcastemail2" name="sendbcastemail" onClick="hide('showhidesendbcastemail')" value="No" checked="#sendbcastemail2_Checked#">No
<cfinput type="radio" id="sendbcastemail1" name="sendbcastemail" onClick="show('showhidesendbcastemail')" value="Yes" checked="#sendbcastemail1_Checked#">Yes
<cfdiv id="showhidesendbcastemail" style="visibility:#showhidesendbcastemaildate#">Select date:<br>
<cfinput type="datefield" name="sendbcastemaildate" value="#getLastedit.sendbcastemaildate#" validate="date" message="Enter a Valid Date" >
</cfdiv>
