Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old July 18th, 2003, 09:10 AM
Steffy Steffy is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 1 Steffy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question Message Box

Hey everyone,
Got a quick question for you all. I'm trying to go a form validation by using the onsubmit event. The onsubmit event works fine and a little msgbox appears when they do not select something in the drop down boxes, but the problem is that the msgbox re-appears after you hit "ok" the first time. Anybody have any idea why?

Here is my code:

<script language="vbscript">
dim validation

Function MyForm_OnSubmit
validation = true
If (Document.myForm.Num.Value) = "" Then
MsgBox "Please select a document number."
validation = False
End If

If (Document.myForm.Originator.Value) = "" Then
MsgBox "Please select an originator."
validation = False
End If

If validation = True Then
MyForm_OnSubmit = True

Else

MyForm_OnSubmit = False

End If

End Function


</script>

<form action="addNew.asp" name="myForm" method="post" onSubmit="MyForm_OnSubmit">

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreVisual Basic Programming > Message Box


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway