I have a javascript function that foxbox kindly provided me with on another ASP related thread.
Basically i'd like to take this function and add a split within it.
here is the code:
Basically i want to be able to split the value so i only get one, two, three or four in the input box rather than 1 one, 2 two, 3 three or 4 four.
Can anyone help?
Thanks.
Ah dinnae ken...
Basically i'd like to take this function and add a split within it.
here is the code:
Code:
<script language="javascript">
function FillText() {
var selObj = document.getElementById('EditStock');
var txtObj = document.getElementById('EditDescription');
var selIndex = selObj.selectedIndex;
var txt = txtObj.value;
txtObj.value = selObj.options[selIndex].text;
}
</script>
<form method="post" action="edit.asp">
<select name="EditStock" id="EditStock" onchange="FillText();">
<option value="AA">1 One</option>
<option value="BB">2 Two</option>
<option value="CC">3 Three</option>
<option value="DD">4 Four</option>
</select>
<input type="text" id="EditDescription" name="EditDescription" />
</form>
Basically i want to be able to split the value so i only get one, two, three or four in the input box rather than 1 one, 2 two, 3 three or 4 four.
Can anyone help?
Thanks.
Ah dinnae ken...