Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I created a page.It contains many textbox control,dropdownlist,button.I given to required field validater for textboxes,dropdown.Also type "*" for requiredfieldvalidater text property.I need message on master page "Please fill data".This message display only one time when any required validater text(*) displayed.

I use validation summery.But it display error message of all validater.


Pls help me.
Posted
Comments
demouser743 15-Oct-10 5:20am    
I did not get you can you be more specific regarding the question please

1 solution

Example:

Javascript code:
function fnOnUpdateValidators() {
var flag = true;
for (var i = 0; i < Page_Validators.length; i++) {

var val = Page_Validators[i];
var ctrl = document.getElementById(val.controltovalidate);

if (ctrl != null) {

if (!val.isvalid) {
flag = false;
}
}
}

if(flag==false)
document.getElementById("masterPageLabel").visible = true;
else
document.getElementById("masterPageLabel").visible = false;
}

C# code
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
Page.ClientScript.RegisterOnSubmitStatement(this.GetType(), "val", "fnOnUpdateValidators();");
}
 
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