Click here to Skip to main content
15,899,754 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi I am using Client Side validation for various Text box, i need to display all message on single Submit Button Click.

Please Help me ASAP
Posted
Comments
[no name] 29-Jul-13 14:53pm    
Help you with what ASAP?
vana Bharadwaj 29-Jul-13 14:54pm    
Help me with SUggestion, what to do and how to reslove it.
[no name] 29-Jul-13 15:02pm    
Oh! Well that is easy then. Learn some javascript, then write some code so when the submit button is clicked, in the event handler, do your validations, when the validations are all done, show an alert box showing whatever message you want. Don't know what it is that you want to resolve. You have not told us anything about your problem yet.
vana Bharadwaj 29-Jul-13 15:12pm    
Oh! well this is know, but the main thing is i have 8 text boxes like Date From and To and Passing percentage From and To, i need to check if To value is filled and From not filled i have to display message, like this i have to validate to all 8 and display on one clcik.??
Dholakiya Ankit 30-Jul-13 0:13am    
solution2 is right

 
Share this answer
 
This is a typical beginner's problem.

You can do either of two thing.
1. When one validation fails, alert the message and return immediately. i.e.
JavaScript
if(isNaN(value)==true)
{
 alert("Numeric value is expected");
 return false;
}


2. As you wanted, gather all error message in one variable and alert it. i.e.
JavaScript
var msg="";
if(isNaN(value1)==true)
{
  msg+="Input Field1 must have to be numeric";
}
if(value2=='')
{
 msg+="\nInput Field2 cannot be empty";
}

if(msg=="")
 return true;

alert(msg);
return false;
 
Share this answer
 

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