-
in VBScript, how can i reference a form in the html page. What i am looking for is the equivalent to document.form.field1 in JavaScript.
Also, how do i detect the length of a field when the submit button is pressed, then display a message box depending on the length. thanks. I know how to do all of this in javascript, but i want to try it in vbscript.
Kagey
-
The syntax is pretty much the same:
Code:
document.frmMyForm.txtTextBox
If your using Interdev, you will have Intellisense that help.. Also, you don't really need the document object to access the form, just the name of the form like:
Code:
frmMyForm.txtTextBox
For the length of the field:
Code:
<SCRIPT Language="VBScript">
Function frmMyForm_onsubmit
If Len(frmMyForm.txtTextBox.Value) > 10 Then
window.alert "Hey! That's too long!"
frmMyForm_onsubmit = False
End If
End Function
</SCRIPT>
[Edited by monte96 on 09-30-2000 at 08:16 PM]
-
Thanks
Thanks a million dude. Slicker than a snot on a door knob.
-
In Javascript, We can use
Document.DirList.FileMenu.options[1].text="";
to modify the ListBox's field.
But how can I do that in VBScript ?
I try the same thing statement in VBScript but it said object '1' is needed.
Can any one help me ? Thank you!
-
Well... you should probably have started a new thread for it.. but....
Code:
Document.DirList.FileMenu.options(1).innertext=""
Document.DirList.FileMenu.options(1).value=""
(I'm assuming you've declared your form's name to be DirList and your SELECT's name to be FileMenu.. if not.. all bets are off..)