shadiadi
08-20-2002, 01:47 PM
Hi there,
I am having a problem with this script.
Here is what it is supposed to do.
When I select a number the value of that number i.e 1 = 275.00
should appear in the second empty box.
Here is the script.
<html>
<title></title>
<head>
<script language="javascript">
function myjunk ()
{
var hat = this.document.validation.myname.selectedIndex
var hatto = this.document.validation.myname.options[hat].value
if (hatto != 'Select one') {
this.document.validation.myformname.value = hatto
this.document.validation.myname.options[0].selected=true
}
}
</script>
</head>
<body>
<form name="myformname">
<select name="myname" onchange="myjunk();">
<option value="Select one">Select a number</option>
<option value="275.00">option 1 - 275.00</option>
<option value="550.00">option 2 - 550.00</option>
<option value="825.00">option 3 - 825.00</option>
<option value="1100.00">option 4 - 1100.00</option>
<option value="1375.00">option 51375.00</option>
</select>
<input type="text" name="myformname">
</form>
</body>
</html>
Can anyone see what is wrong with it or have a better idea to approach this?
It will be much appreciated
:confused:
I am having a problem with this script.
Here is what it is supposed to do.
When I select a number the value of that number i.e 1 = 275.00
should appear in the second empty box.
Here is the script.
<html>
<title></title>
<head>
<script language="javascript">
function myjunk ()
{
var hat = this.document.validation.myname.selectedIndex
var hatto = this.document.validation.myname.options[hat].value
if (hatto != 'Select one') {
this.document.validation.myformname.value = hatto
this.document.validation.myname.options[0].selected=true
}
}
</script>
</head>
<body>
<form name="myformname">
<select name="myname" onchange="myjunk();">
<option value="Select one">Select a number</option>
<option value="275.00">option 1 - 275.00</option>
<option value="550.00">option 2 - 550.00</option>
<option value="825.00">option 3 - 825.00</option>
<option value="1100.00">option 4 - 1100.00</option>
<option value="1375.00">option 51375.00</option>
</select>
<input type="text" name="myformname">
</form>
</body>
</html>
Can anyone see what is wrong with it or have a better idea to approach this?
It will be much appreciated
:confused: