Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


newbie stuck of form validation

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,1190
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> newbie stuck of form validation
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 newbie stuck of form validation - 7/28/2004 3:53:51 AM   
  Encry

 

Posts: 5
Score: 0
Joined: 7/21/2004
From:
Status: offline
even though the conditions have been met to terminate the form submit the submit button does it anyway. Any help would be greatly appreciated.

<SCRIPT language = "VBScript">

Function Submit_onclick

dim validation
dim header
Header = "Application Submission"
validation = true



Call Check(Document.frmuserinformation.BankName.Value, "Please enter The Bank Name.")
call Check(Document.frmuserinformation.[Bank Fax Number].Value, "Please enter Bank Fax Number.")
Call Check(Document.frmuserinformation.[Bank Phone Number].Value, "Please enter Bank Phone Number.")
Call Check(Document.frmuserinformation.[Fax Number for Stop Payments].Value, "Please enter Fax Number for Stop Payments.")
Call Check(Document.frmuserinformation.[Bank Address].Value, "Please enter Bank Address.")
Call Check(Document.frmuserinformation.Branches.Value, "Please enter Branches.")
Call Check(Document.frmuserinformation.[Bank Website Address].Value, "Please enter Bank Website Address.")
Call Check(Document.frmuserinformation.[Internet Banking Website].Value, "Please enter Internet Banking Website.")
Call Check(Document.frmuserinformation.[Email Address].Value, "Please enter Email Address.")
Call Check(Document.frmuserinformation.[Bank ABA#].Value, "Please enter Bank ABA#.")
Call Check(Document.frmuserinformation.[DDA Account for Serv. Charge].Value, "Please enter DDA Account for Serv. Charge.")
Call Check(Document.frmuserinformation.[Bank Tax Id#].Value, "Please enter Bank Tax Id#.")
Call Check(Document.frmuserinformation.[ACH Destination ID#].Value, "Please enter ACH Destination ID#.")
Call Check(Document.frmuserinformation.[ACH Originator ID#].Value, "Please enter ACH Originator ID#.")
Call Check(Document.frmuserinformation.[ACH Destination Name].Value, "Please enter ACH Destination Name.")
Call Check(Document.frmuserinformation.[ACH Originator Name].Value, "Please enter ACH Originator Name.")
Call Check(Document.frmuserinformation.[ACH File Modifier].Value, "Please enter ACH File Modifier.")
Call Check(Document.frmuserinformation.[ACH TaxID Prefix].Value, "Please enter ACH TaxID Prefix.")
Call Check(Document.frmuserinformation.[ACH Fee].Value, "Please enter ACH Fee.")
Call Check(Document.frmuserinformation.[Fee Per File].Value, "Please enter Fee Per File.")
Call Check(Document.frmuserinformation.[Fee Per Transaction].Value, "Please enter Fee Per Transaction.")
Call Check(Document.frmuserinformation.[Fee Per PreNote].Value, "Please enter Fee Per PreNote.")
Call Check(Document.frmuserinformation.[# Of Free Files].Value, "Please enter # Of Free Files.")
Call Check(Document.frmuserinformation.[# of Free Transactions].Value, "Please enter # of Free Transactions.")
Call Check(Document.frmuserinformation.[# of Free PreNotes].Value, "Please enter # of Free PreNotes.")
Call Check(Document.frmuserinformation.[Dimension Bank#].Value, "Please enter Dimension Bank#.")
Call Check(Document.frmuserinformation.[Dimension Teller#].Value, "Please enter Dimension Teller#.")




End Function


Sub Check(ByVal FieldValue, ByVal message)
If FieldValue = "" Then
MsgBox message, 0, Header
validation = false

If validation = True Then
frmUserInformation.submit
Msgbox"Your Application will now be sent Via Email",0,"Form Submission"
else
msgbox"One of the data fields is incorrect"

end if
End If
End Sub
</script>








<FORM id=Form1 name=frmUserInformation action=MAILTO:suzie@suzette.com method=post encType=text/plain>


<INPUT id=Submit1 onclick=submit_onclick value="Submit Data" type= submit name="End of">
 
 
Post #: 1
 
 Re: newbie stuck of form validation - 7/28/2004 4:42:14 AM   
  deden

 

Posts: 7
Score: 0
Joined: 6/20/2004
From:
Status: offline
Well.. I don't know if this is satisfactory answer to you but you can replace
<INPUT id=Submit1 onclick=submit_onclick value="Submit Data" type= submit name="End of">
with
<INPUT id=Submit1 onclick=submit_onclick value="Submit Data" type=button name="End of">

and the script should be working.

(in reply to Encry)
 
 
Post #: 2
 
 Re: newbie stuck of form validation - 7/28/2004 5:50:48 AM   
  Encry

 

Posts: 5
Score: 0
Joined: 7/21/2004
From:
Status: offline
i did that and it didn't send the email even though the validation = false like it was before which is a step in the right direction but now it won't send the email even when validation = true, thank you for your response.


encry

(in reply to Encry)
 
 
Post #: 3
 
 Re: newbie stuck of form validation - 7/28/2004 7:01:18 AM   
  deden

 

Posts: 7
Score: 0
Joined: 6/20/2004
From:
Status: offline
Umm I suspect that you should put the msgbox first before submitting the form

Change this:

frmUserInformation.submit
Msgbox"Your Application will now be sent Via Email",0,"Form Submission"

to:

Msgbox"Your Application will now be sent Via Email",0,"Form Submission"
frmUserInformation.submit

(in reply to Encry)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> newbie stuck of form validation Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts