The CheckValues function returns either "true" or "false". If it returns "false", execution is terminated.
Main Topics
Browse All TopicsHello Experts,
I have a standard HTML form, with 5 mandatory fields.
How is it possible, when the user clicks Submit, the submit button to first call a function to check if these 5 fields are blank. And if so, cancel submit and display message?
Below, is a psedo code of what I need:
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Actually, I did something else...
For testing I added the code below
Now I get:
Webpage error details
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.3; .NET CLR 1.1.4322; InfoPath.1; .NET CLR 2.0.50727)
Timestamp: Wed, 4 Nov 2009 20:52:15 UTC
Message: 'txtCompany.value' is null or not an object
Line: 28
Char: 3
Code: 0
Sorry, closed too soon
For text fields, this works well:
if(frm.txtCompany.val
{
alert('The Company field is mandatory');
return false;
}
However,. I tried the following for a dropdown, where *** Please Select *** is not a valid selection, but nothing happens:
if(frm.cboModule.value == '*** Please Select ***')
{
alert('The Module field is mandatory');
return false;
}
As well, I also need to validate if a radio button is selected within a group, I can't imagine the code for tha.
Please help
Business Accounts
Answer for Membership
by: frankkyPosted on 2009-11-03 at 10:17:00ID: 25731775
Here's a link that might help:
om/javascr ipt/form_v alidation. php
http://www.webcheatsheet.c