Click here to Skip to main content
15,903,854 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have text boxes and drop downs in my form.and I have a button named"search". when i enter the values and click on the search button I have display the search results.Entering all values is not required,user has to enter at least one value otherwise we have to give validation message that Enter at least one value. how can i do this validation?
I gave like:
var fn = myForm.getItemValue("FirstName");
var ln = myForm.getItemValue("LastName");
var c = myForm.getItemValue("City");
var st = myForm.getItemValue("State");
var cnt = myForm.getItemValue("Country");
var zc = myForm.getItemValue("Zipcode");
var em = myForm.getItemValue("Email");
var ph = myForm.getItemValue("Phone");
if (fn == "" && ln == "" && c == "" && st == "" && zc == "" && em == "" && ph == "" ) {
alert("please enter atleast one value");
}
my alert is working fine.but i want to display validation message in the form that"please enter atleast one field" at the top of the form.can u tel me how to this
Posted
Updated 8-Aug-12 3:19am
v2

1 solution

hi chandran
if your getting values from database in search result,
for that associated button we need to write Sp ,when ever you click on button it will displays the associated values.
 
Share this answer
 
Comments
charan1431 7-Aug-12 0:49am    
actually i want to give validate message, when user has not entered any values and click on the search button.
This is client side validation.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900