Link to home
Start Free TrialLog in
Avatar of traport
traport

asked on

Hidden division changed to Show when page reloaded

I'm using this script to toggle the visibility on my page.

 
<script type="text/javascript">
	function toggleq6(evt) {
	evt = (evt) ? evt : event;
	var target = (evt.target) ? evt.target : evt.srcElement;
	var block = document.getElementById("q6Data");
	if (target.id == "q5Flag1") {
		block.style.display = "block";
	} else {
		block.style.display = "none";  
	}
		
	}
</script>

Open in new window


and this is the section it toggles:

 
<li>Did you utilize <b>past performance</b> or <b>other PDO writing</b> services on this proposal?  
<div>
<input type="radio" name="q5" id="q5Flag1" value="1" onclick="toggleq6(event)" <cfif url.q5 EQ 1>checked</cfif>> Yes 
<input type="radio" name="q5" id="q5Flag0"value="0" onclick="toggleq6(event)" <cfif url.q5 EQ 0>checked</cfif>> No</div>
</li>
</ol>
<div id="q6Data" style="display:none; margin: 0 0 15px 0px">
<ol start="6">
<li>How would you rate your <b>overall experience</b> with <b>PDO's past performance or other writing services</b><br />on this proposal? <br />
<table cellpadding="0" cellspacing="0" class="noborder surveyQuestion">
	<tr>
    	<td><input type="radio" name="q6" value="-5" <cfif url.q6 EQ "-5">checked</cfif>/>-5&nbsp;</td>
    	<td><input type="radio" name="q6" value="-4" <cfif url.q6 EQ "-4">checked</cfif>/>-4&nbsp; </td>
    	<td><input type="radio" name="q6" value="-3" <cfif url.q6 EQ "-3">checked</cfif>/>-3&nbsp;</td>
    	<td><input type="radio" name="q6" value="-2" <cfif url.q6 EQ "-2">checked</cfif>/>-2&nbsp;</td>
    	<td><input type="radio" name="q6" value="-1" <cfif url.q6 EQ "-1">checked</cfif>/>-1&nbsp;</td>
    	<td><input type="radio" name="q6" value="0" <cfif url.q6 EQ "0">checked</cfif>/>0&nbsp;</td>       
    	<td><input type="radio" name="q6" value="+1" <cfif url.q6 EQ "+1">checked</cfif>/>+1&nbsp;</td>
    	<td><input type="radio" name="q6" value="+2" <cfif url.q6 EQ "+2">checked</cfif>/>+2&nbsp;</td>
    	<td><input type="radio" name="q6" value="+3" <cfif url.q6 EQ "+3">checked</cfif>/>+3&nbsp;</td>
    	<td><input type="radio" name="q6" value="+4" <cfif url.q6 EQ "+4">checked</cfif>/>+4&nbsp;</td>
    	<td><input type="radio" name="q6" value="+5" <cfif url.q6  EQ "+5">checked</cfif>/>+5&nbsp;</td>
    </tr>

Open in new window

...

When the user is returned to the page having selected yes to the toggle how can I have Q6 automatically showing?

I hope this makes sense!
ASKER CERTIFIED SOLUTION
Avatar of Sudhindra A N
Sudhindra A N
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of traport
traport

ASKER

Thanks so much!