beat
08-22-2005, 09:00 AM
Hi
Because of design reasons I have two different select tags (different width with css). How can I pass the selected value in select1? With alert I can see the value but I couldn't actualize the value.
<script type="text/javascript">
function sendoption () {
for (i = 0; i < document.xxForm.select2.length; ++i)
if (document.xxForm.select2.options[i].selected == true)
alert(document.xxForm.select2.options[i].value);
}
</script>
<form name="xxForm" method="post" action="">
<div id="m1">
<select name="select1" class="select">
<option value="a1">a1</option>
<option value="a2">a2</option>
</select>
</div>
<div id="m2">
<select name="select2" onChange="sendoption()">
<option value="b1">b1</option>
<option value="b2">b2</option>
</select>
</div>
</form>
Kind regards
Beat
Because of design reasons I have two different select tags (different width with css). How can I pass the selected value in select1? With alert I can see the value but I couldn't actualize the value.
<script type="text/javascript">
function sendoption () {
for (i = 0; i < document.xxForm.select2.length; ++i)
if (document.xxForm.select2.options[i].selected == true)
alert(document.xxForm.select2.options[i].value);
}
</script>
<form name="xxForm" method="post" action="">
<div id="m1">
<select name="select1" class="select">
<option value="a1">a1</option>
<option value="a2">a2</option>
</select>
</div>
<div id="m2">
<select name="select2" onChange="sendoption()">
<option value="b1">b1</option>
<option value="b2">b2</option>
</select>
</div>
</form>
Kind regards
Beat