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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to make this validation code work

Status
Not open for further replies.

longmatch

Programmer
Nov 1, 2001
406
I want to validate the user input for required field. I am using vbscript to validate:

if ProcedureData.Rotation.value = "" then

msgbox("Please enter rotation data")
validation = false
end if

But it is very strange. When I left this field empty, the messgebox came out and submission of this form failed. However we I put something in this field after receiving messages, the msgbox still came out. WHY?????

Thanks

haijun
 
Hi!

Hope this doesn't offend you, but does the field actually have any data when it gets here?

The reason I ask, is I did this quick test & if the variable "test" is blank - error message; of not blank - no error message.

Code:
test = "xyz"
if test = "" then        
  msgbox("Please enter rotation data")
  validation = false
end if
Hope this helps,
Jessica
[ponytails2]
 
I tried several times. Even though I selected one items from the combo box, or have manually input in textbox. I still got error message. I do not know why. I was trying to use isempty() or isnull method instead, have not fixed the problem yet. I will try your code to see what will be happening.

Thanks

Haiju
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top