I have a script:
sub check_input(myInput)
If document.getElementByID(myInput).value = "input" then
msgbox "This entry must be a number"
document.getElementByID(myInput).select
stat.cancel
end if
end sub
This pulls a variable from a form on another page, called through an onChange attached to the input. What I am trying to do it the same function, but with a specific reference to the actual document.myForm.myInput instead of the getElementsByID
I am a little confused (this is my first time working with VBScript). If I have a direct reference from the function to the form field on the other page, do I still have to pass the variable? The input type is a select drop down.
Please don't laugh at my attempt and confustion!
<select name="myInput" onChange="check_myInput(myInput.selectedindex')">
sub check_myInput(myInput)
If document.myForm.myInput.options(myinput).value = "input" then
msgbox "This entry must be a number"
document.myForm.myInput.select
stat.cancel
end if
end sub
Am I all mixed up? Any direction would be greatly appreciated!!!
Thanks,
Va.
sub check_input(myInput)
If document.getElementByID(myInput).value = "input" then
msgbox "This entry must be a number"
document.getElementByID(myInput).select
stat.cancel
end if
end sub
This pulls a variable from a form on another page, called through an onChange attached to the input. What I am trying to do it the same function, but with a specific reference to the actual document.myForm.myInput instead of the getElementsByID
I am a little confused (this is my first time working with VBScript). If I have a direct reference from the function to the form field on the other page, do I still have to pass the variable? The input type is a select drop down.
Please don't laugh at my attempt and confustion!
<select name="myInput" onChange="check_myInput(myInput.selectedindex')">
sub check_myInput(myInput)
If document.myForm.myInput.options(myinput).value = "input" then
msgbox "This entry must be a number"
document.myForm.myInput.select
stat.cancel
end if
end sub
Am I all mixed up? Any direction would be greatly appreciated!!!
Thanks,
Va.