|
-
Sep 30th, 2000, 02:20 PM
#1
Thread Starter
Hyperactive Member
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
-
Sep 30th, 2000, 07:07 PM
#2
Frenzied Member
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]
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
-
Sep 30th, 2000, 08:27 PM
#3
Thread Starter
Hyperactive Member
Thanks
Thanks a million dude. Slicker than a snot on a door knob.
-
Oct 4th, 2000, 05:14 AM
#4
New Member
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!
-
Oct 4th, 2000, 10:01 AM
#5
Frenzied Member
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..)
oOOo--oOOo
__ /\/\onte96
oOOo--oOOo
Senior Programmer/Analyst
MCP
[email protected]
[email protected]
Your results may vary.. some restrictions may apply.. pricing and participation may vary.. not available in all states.. professional driver closed course..quantities limited..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|