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!

HTA vs HTML

Status
Not open for further replies.

ZmrAbdulla

Technical User
Apr 22, 2003
4,364
AE
I am trying to create an xml file through the details entered in the fields in an HTML page using vbscript. It works as I required with a small problem.
If I execute an HTA file then the errorchecking is done, not when the script is executed from an html page.
Error cheking code is below
Code:
If Len(txtName.Value)=0 then
	MsgBox "Please enter your name",0,"Error"
ElseIf Len(txtCont.Value)=0 then
	MsgBox "Please enter a contact number",0,"Error"
ElseIf Len(txtDept.Value)=0 then
	MsgBox "Please enter the department name",0,"Error"
ElseIf len(txtMsg.Value)=0 then
	MsgBox "Please enter the message",0,"Error"
else	
	' Do stuff
End If
Is there anything that I am missing?



Zameer Abdulla
 
Sorted.
I had to add a form Name
Code:
<FORM NAME="frmMaint">
and rewrite the error checking lines to
Code:
If Len(document.frmMaint.txtName.Value)=0 then
...

Zameer Abdulla
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top