mattturley
asked on
JavaScript to change Frame Source using HTML Form Select values
I am trying to change the source of the current frame using a Form Select value and the onclick of a button. For instance, my select and button would look like this.
<form name="form1">
<select name="menu1">
<option value="#">Menu</option>
<option value="L1T1_01.htm">Object ives</opti on>
<option value="L2T1_01.htm">Introd uction</op tion>
<option value="L3T1_01.htm">Overvi ew of Constitutional History</option>
<option value="L4T1_01.htm">Bill of Rights</option>
<option value="L5T1_01.htm">What the Constitution Means to You</option>
<option value="L6T1_01.htm">Summar y </option>
</select>
<input type="button" name="Button1" value="Go" onClick="MM_jumpMenuGo()">
</form>
From here, I have thought of many ways to write the MM_jumpMenuGo function, but none have worked.
Any thoughts?
Your help would be greatly appreciated!
Matt
<form name="form1">
<select name="menu1">
<option value="#">Menu</option>
<option value="L1T1_01.htm">Object
<option value="L2T1_01.htm">Introd
<option value="L3T1_01.htm">Overvi
<option value="L4T1_01.htm">Bill of Rights</option>
<option value="L5T1_01.htm">What the Constitution Means to You</option>
<option value="L6T1_01.htm">Summar
</select>
<input type="button" name="Button1" value="Go" onClick="MM_jumpMenuGo()">
</form>
From here, I have thought of many ways to write the MM_jumpMenuGo function, but none have worked.
Any thoughts?
Your help would be greatly appreciated!
Matt
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Many thanks!! This worked like a charm without having to change my frameset.
function frame_src(url)
{
document.getElementById("f
}
</script>
<form name="form1">
<select name="menu1" onchange="frame_src(this.v
<option value="#">Menu</option>
<option value="http://www.google.com">Objectives</optio
<option value="L2T1_01.htm">Introd
<option value="L3T1_01.htm">Overvi
<option value="L4T1_01.htm">Bill of Rights</option>
<option value="L5T1_01.htm">What the Constitution Means to You</option>
<option value="L6T1_01.htm">Summar
</select>
<input type="button" name="Button1" value="Go" onClick="MM_jumpMenuGo()">
</form>
<iframe id=frame_ele src="" width=500 height=500></iframe>