Forum Moderators: open
Now I used a bunch of this code from a generator, a walk through page, and some other sources. I hacked the hell out of it and its likely very ugly but it does what I need so I apologize in advance.
<p>
<select onchange="window.open(this.options[this.selectedIndex].value,'iframe');this.selectedIndex=0;" name="config">
<option value="instructions.html"> Configuration Options </option>
<option value="option1.html"> Configuration option 1 </option>
<option value="option2.html"> Configuration option 2 </option>
<option value="option3.html"> Configuration option 3 </option>
<option value="option4.html"> Configuration option 4 </option>
</select>
</p>
So it shows the right .html in the iframe, I just need to pass the pull down text of each option, how would I go about this?
Thanks again for bearing with my newbieness.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title> New Document </title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<body><form action="" method="">
<fieldset>
<legend>The list box</legend>
<select onchange="sendValue(this);" name="config">
<option value="instructions.html"> Configuration Options </option>
<option value="option1.html"> Configuration option 1 </option>
<option value="option2.html"> Configuration option 2 </option>
<option value="option3.html"> Configuration option 3 </option>
<option value="option4.html"> Configuration option 4 </option>
</select>
</fieldset>
</form><script type="text/javascript">
function sendValue(myObj){
newLocation = myObj.options[myObj.selectedIndex].value;
document.getElementById('theFrame').src = newLocation;
}
</script><iframe id="theFrame" name="iframe" src="instructions.html" align="top" height="460" width="760"></iframe>
</body>
</html>
It looks like the pulldown is simplified greatly. And the script is separated out of the actual pulldown? The function will send the text? or the actual value?
Thanks for your help, and sorry I'm such a newb.
I was hoping there would be some easy way to do this. Like labeling each option in the pull down or changing the this.selectedIndex= to something.
Am I understanding you correctly now? All you want to do is take the text "configuration option N" and have it sent to the iframe? (the iframe I assume conatins the script that will send the email)
What confuses me is what is value="option N .html" for?
Thanks again for your time, I really appreciate your help!
Thanks for your Help Trace, I just don't know enough to have anyone help me it seems, shy of teaching me how to do it from the get go:P
So I just renamed my html files to these really long sentences with all the info I needed and stripped the file extension off. It still displays properly, and gives me exactly what I need.
thanks anyhow!