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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onChange issue

Status
Not open for further replies.

deluxmilkman

Programmer
Sep 26, 2007
17
0
0
JP
I have 2 html menu.html and menu2.html,
and would like to swich one another using "onChange" in each form.

function pageCh works first time, but it doesn't 2nd time.
alert("menu2") does not pop up either.




javascript in menu.html
HTML:
<script language="JavaScript" type="text/JavaScript">
<!--
function pageCh(sectionURL) {

parent.section.location.href = sectionURL;
if(sectionURL == "section02.xml") {
parent.menu.location.href = "menu2.html";
}
}

//-->
</script>

form in menu.html


HTML:
<form>
<select onChange="pageCh(this.value)">
	<option value="section01.xml" selected>1/option>
	<option value="section02.xml">2</option>
</select>
</form>




javascript in menu2.html

HTML:
<script language="JavaScript" type="text/JavaScript">
<!--

alert("menu2");

function pageCh(sectionURL) {
alert(sectionURL);
parent.section.location.href = sectionURL;
if(sectionURL == "section01.xml") {
parent.menu.location.href = "menu.html";


}

//-->
</script>

form in menu2.html

HTML:
<form>
<select onChange="pageCh(this.value)">
	<option value="section02.xml" selected>2</option>
	<option value="section01.xml">1</option>
</select>
</form>


thanks
 
Try add no-cache metas in the head section of each of the pages.
[tt]
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Expires" content="-1" />
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top