Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

make div visible after submit and back button

Status
Not open for further replies.

ixnay5

MIS
Jan 10, 2002
68
0
0
US

hi again..

if my form has divs like this:

Code:
<DIV ID="DS3Div" style="visibility:hidden;position:absolute;top:90;left:10">
<LABEL FOR="DS3">
Capacity (DS3):&nbsp;&nbsp;
1:&nbsp;<input type="radio" name="cap" value="1" onclick="DS31();">&nbsp;&nbsp;&nbsp;
2:&nbsp;<input type="radio" name="cap" value="2" onclick="DS32();">&nbsp;&nbsp;&nbsp;
3:&nbsp;<input type="radio" name="cap" value="3" onclick="DS33();">&nbsp;&nbsp;&nbsp;
4:&nbsp;<input type="radio" name="cap" value="4" onclick="DS34();">&nbsp;&nbsp;&nbsp;
5:&nbsp;<input type="radio" name="cap" value="5" onclick="DS35();">&nbsp;&nbsp;&nbsp;
6:&nbsp;<input type="radio" name="cap" value="6" onclick="DS36();">
</LABEL>
</DIV>

<<DIV ID="VocSlaveDIV" style="visibility:hidden;position:absolute;top:100;left:10;">

</DIV>

and onclick functions look like this:

Code:
function DS31() {

	var DS31STR = "<LABEL FOR=\"DS31\">	<br><br>	Vocoder Suite:<br>	G.711:&nbsp;<input type=\"radio\" name=\"vocds31\" value=\"1\" onclick=\"capcheck(this);\"><br>	G.711,G.726&nbsp;<input type=\"radio\" name=\"vocds31\" value=\"2\"  onclick=\"capcheck(this);\"><br>	G.711,G.726,G.729A:&nbsp;<input type=\"radio\" name=\"vocds31\" value=\"3\"  onclick=\"capcheck(this);\"><br>	G.711,G.726,G.729A,G.729E:&nbsp;<input type=\"radio\" name=\"vocds31\" value=\"4\" onclick=\"capcheck(this);\">	</LABEL>";
	
	VocSlaveDIV.innerHTML = DS31STR;
	VocSlaveDIV.style.visibility='visible';
	
}

function DS32() {

	var DS32STR = "<LABEL FOR=\"DS32\">	<br><br>	Vocoder Suite:<br>	G.711:&nbsp;<input type=\"radio\" name=\"vocds32\" value=\"1\" onclick=\"capcheck(this);\"><br>	G.711,G.726&nbsp;<input type=\"radio\" name=\"vocds32\" value=\"2\"  onclick=\"capcheck(this);\"><br>	G.711,G.726,G.729A:&nbsp;<input type=\"radio\" name=\"vocds32\" value=\"3\"  onclick=\"capcheck(this);\"><br>	</LABEL>";
	
	VocSlaveDIV.innerHTML = DS32STR;
	VocSlaveDIV.style.visibility='visible';
	
}
how do i get the div that was visible at submit time to become visible again when the user hits the back button after thesubmit...using javascript?

right now when the user comes back to the form after submit, the form is displayed just as it was prior to submit, but the doggone the div is not displayed.

this doesn't seem right from a user perspective...

 

You could try having an onload event to do this, although there is a possibility that this may not work.

Hope this helps,
Dan
 
dan, how would i make the browser remember which div was displayed prior to the submit?
 
I would think the quick answer would be not to have the user hit the back button, but either provide a link back to the previous page or redirect them automatically. Either way, the form-handler page should be able to tell what div was visible by the input it gets (the radios), and it can pass that info back to the form page, a process I like to call "pseudo-stateful". :)

Hope that helps.


Brad Gunsalus
bardley90@hotmail.com
 
bardley,

i'm new to javascript and i'm looking for a technique in javascript to pass the displayed div info forward to the next page and back again...just as you outlined. i could sure use an example...

the form page is a "configuration" page where inside sales people configure something like a pc. the "form handler" is really just the next step in the process in which the user takes care of "pricing." i need to be able to let the user go back in the event they notice something they want to change.

i know there are things i can do on the server side. and i know i can provide a backward link containing


 
prev. message continued. nevermind the last sentence (fragment)...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top