marvy
Gebruiker
- Lid geworden
- 25 dec 2000
- Berichten
- 396
Ik heb drie tekstvakken
In het eerste komt bv Option/1 . Deze string wil ik eigenlijk via explode opsplitsen zodat tekstvak2 Option bevat en tekstvak3 1.
Hoe kan ik dat invoegen in deze code ?
<script>
function moveText()
{
window.document.testform.testtext.value = window.document.testform.testselect.options[window.document.testform.testselect.selectedIndex].value
}
</script>
<body>
<form name="testform">
Here is the select box:<br><br>
<select name="testselect" onChange="moveText()">
<option value="">- - Select One - -</option>
<option value="Option1">Option/1</a>
<option value="Option2">Option/2</a>
<option value="Option3">Option/3</a>
</select><br><br>
The value of the options is outputted to here:
<input type="text" name="testtext" size="30">
<input type="text" name="testtext1" size="30">
<input type="text" name="testtext2" size="30">
</form>
</body>
In het eerste komt bv Option/1 . Deze string wil ik eigenlijk via explode opsplitsen zodat tekstvak2 Option bevat en tekstvak3 1.
Hoe kan ik dat invoegen in deze code ?
<script>
function moveText()
{
window.document.testform.testtext.value = window.document.testform.testselect.options[window.document.testform.testselect.selectedIndex].value
}
</script>
<body>
<form name="testform">
Here is the select box:<br><br>
<select name="testselect" onChange="moveText()">
<option value="">- - Select One - -</option>
<option value="Option1">Option/1</a>
<option value="Option2">Option/2</a>
<option value="Option3">Option/3</a>
</select><br><br>
The value of the options is outputted to here:
<input type="text" name="testtext" size="30">
<input type="text" name="testtext1" size="30">
<input type="text" name="testtext2" size="30">
</form>
</body>