Please Help with following code.
works in Netscape but not IE.
eval() not used correctly!
function AutoFill(FormName,SelectName,TargetName) {
var v = document.eval(FormName).eval(SelectName).selectedIndex;
var Output = document.eval(FormName).eval(SelectName).options[v].text;
if (Output > 1){
document.eval(FormName).eval(TargetName).value = "Yes"
}
else if (Output == "---") {
document.eval(FormName).eval(TargetName).value = "No"
}
else {
document.eval(FormName).eval(TargetName).value = "No"
}
}
<form name="MyForm">
<input name="MyInput" type="text" size="10">
<select name="MySelect" onchange="AutoFill('MyForm','Myselect','MyInput')">
<option>---
<option>1
<option>2
<option>3
</select>
</form>
Basically, what is the correct coding for:
document.eval(FormName).eval(SelectName).selectedIndex
I know that eval() is not the correct way to code this but I haven't been able to figure out the correct way.
Thanks,
Beetleman
works in Netscape but not IE.
eval() not used correctly!
function AutoFill(FormName,SelectName,TargetName) {
var v = document.eval(FormName).eval(SelectName).selectedIndex;
var Output = document.eval(FormName).eval(SelectName).options[v].text;
if (Output > 1){
document.eval(FormName).eval(TargetName).value = "Yes"
}
else if (Output == "---") {
document.eval(FormName).eval(TargetName).value = "No"
}
else {
document.eval(FormName).eval(TargetName).value = "No"
}
}
<form name="MyForm">
<input name="MyInput" type="text" size="10">
<select name="MySelect" onchange="AutoFill('MyForm','Myselect','MyInput')">
<option>---
<option>1
<option>2
<option>3
</select>
</form>
Basically, what is the correct coding for:
document.eval(FormName).eval(SelectName).selectedIndex
I know that eval() is not the correct way to code this but I haven't been able to figure out the correct way.
Thanks,
Beetleman