TravisLaborde
IS-IT--Management
Using VBScript, and intending to run in IE6, I am trying to do something that seems simple from looking at the object model, but just isnt working...
Basically I have a form, with various INPUT tags and a BUTTON. I put VBScript code to the onClick event of the button, and I want it to cycle thru each field in the form, and take action. I'll work on the actions later, I can't even cycle thru the form yet. Please take a look at this code and help me if you can:
<body>
<form method=post id=theForm name=theForm>
<input type=text name=field_one id=field_one><br>
<input type=text name=field_two id=field_two><br>
<input type=button name=btnGO id=btnGO value=GO>
</form>
</body>
<script language=vbscript>
sub btnGnClick()
for each field in document.forms(0)
msgbox field.name
next
end sub
</script>
Now, I've tried all sorts of things, including document.forms(0).children(x) whatever... no luck. I can't even get one to show up, much less cycle thru them.
Please help if you can.
Travis
Basically I have a form, with various INPUT tags and a BUTTON. I put VBScript code to the onClick event of the button, and I want it to cycle thru each field in the form, and take action. I'll work on the actions later, I can't even cycle thru the form yet. Please take a look at this code and help me if you can:
<body>
<form method=post id=theForm name=theForm>
<input type=text name=field_one id=field_one><br>
<input type=text name=field_two id=field_two><br>
<input type=button name=btnGO id=btnGO value=GO>
</form>
</body>
<script language=vbscript>
sub btnGnClick()
for each field in document.forms(0)
msgbox field.name
next
end sub
</script>
Now, I've tried all sorts of things, including document.forms(0).children(x) whatever... no luck. I can't even get one to show up, much less cycle thru them.
Please help if you can.
Travis