Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referencing form controls

Status
Not open for further replies.

Ruffell

Programmer
Jun 24, 2003
1
GB
Hi all,

I've only just started learning VBScript today - and I've got two questions.

First, how can I replicate the "this" functionality from JavaScript, so a line in HTML can read:

<input onsubmit=&quot;validate(this)&quot;>

And my function would then be

Function validate(SourceControl)


Second, how can I copy a form control reference to a variable, so instead of typing &quot;Document.mainForm.controlName&quot; each time I can just have code like:

dim curControl
curControl = Document.mainForm.controlName


And then refer to curControl from then on? Any help on these two questions would be much appreciated!

Thanks,

Russell
 
Have you tried this ?
Code:
dim curControl
set curControl = Document.mainForm.controlName


Hope This Help
PH.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top