?
Solved

Hidden division changed to Show when page reloaded

Posted on 2011-09-26
2
Medium Priority
?
179 Views
Last Modified: 2012-05-12
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!
0
Comment
Question by:traport
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 13

Accepted Solution

by:
ansudhindra earned 2000 total points
ID: 36599837
try like this...

<cfif isdefined('form.q6') and trim(form.q6) neq "">
       <div id="q6Data" style="display:block; margin: 0 0 15px 0px">
<cfelse>
       <div id="q6Data" style="display:none; margin: 0 0 15px 0px">
</cfif>

where "form.q6" -  if the form is submitted to istself and showing it to user
or replace with the proper variable name if you are loading the values from database..

Br-Sudhindra-www.clicksperday.com
0
 

Author Closing Comment

by:traport
ID: 36600255
Thanks so much!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
This article discusses how to implement server side field validation and display customized error messages to the client.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
Suggested Courses

800 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question