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

on select change??

Status
Not open for further replies.

Naits

Programmer
Oct 10, 2001
90
NO
How to get the value of the opention when the select changes in a form? __________________
Visit my homepage
.: Game universE :.
 
<html><head><title>Test</title>
</head><body>
<form name=&quot;Testform&quot; action=&quot;&quot;>
Name: <input size=&quot;30&quot; name=&quot;Name&quot;>
<input type=&quot;submit&quot; name=&quot;Absendebutton&quot; value=&quot;Absenden&quot;>
<input type=&quot;hidden&quot; name=&quot;Browser&quot; value=&quot;&quot;>
</form>
<script type=&quot;text/javascript&quot;>
<!--
document.Testform.Browser.value = navigator.userAgent;
document.write(document.Testform.Browser.value);
//-->
</script>
</body></html>

HTH cu, Sascha
 
Oops, posted the wrong example. Here we go:

<html><head><title>Test</title>
</head><body>
<script type=&quot;text/javascript&quot;>
<!--
function selectChanged() {
alter(document.Testform.Selection.value);
}
//-->
</script>
<form name=&quot;Testform&quot; action=&quot;&quot;>
<select name=&quot;Selection&quot; size=&quot;1&quot; onChange=&quot;javascript:selectChanged();&quot;>
<option value=&quot;Opt1&quot;>Option 1</option>
<option value=&quot;Opt2&quot;>Option 2</option>
<option value=&quot;Opt3&quot;>Option 3</option>
<option value=&quot;Opt4&quot;>Option 4</option>
</select>
</form>
</body></html>

again HTH :) cu, Sascha
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top