G
goscottie
I need to find a way to either
1. run and check all Validation controls (in my case one
CompareValidator) and run client side javascript function. In this
case I'll use <asp:Button>. So if all validation passes, run custom
javascript. Or.
2. from my client side javascript to run Validation check and then
perform remaining client side function. So in this case I'll use
<input type="button">.
So far, challenge in case 1 is how to capture validation failure and
limit and stop further client side code execution. I had this code.
Button_Search.Attributes.Add("onclick",
Page.ClientScript.GetPostBackEventReference(Button_Search, "") +
";Search();");
where Search() is my client side function, which gets executed with
failed client side validation.
In case 2, I would like to do something like... (I'm doing this with
RegisterClientScriptBlock)
function Search()
{
window.top._somevalue = 'xyz';
if (whateverclientvalidationfuctioniscalled()) // client side
validation function name generated by ASP.NET
window.top.hidePopWin();
}
<input type="button" onclick="Search();">
Any help appreciated.
1. run and check all Validation controls (in my case one
CompareValidator) and run client side javascript function. In this
case I'll use <asp:Button>. So if all validation passes, run custom
javascript. Or.
2. from my client side javascript to run Validation check and then
perform remaining client side function. So in this case I'll use
<input type="button">.
So far, challenge in case 1 is how to capture validation failure and
limit and stop further client side code execution. I had this code.
Button_Search.Attributes.Add("onclick",
Page.ClientScript.GetPostBackEventReference(Button_Search, "") +
";Search();");
where Search() is my client side function, which gets executed with
failed client side validation.
In case 2, I would like to do something like... (I'm doing this with
RegisterClientScriptBlock)
function Search()
{
window.top._somevalue = 'xyz';
if (whateverclientvalidationfuctioniscalled()) // client side
validation function name generated by ASP.NET
window.top.hidePopWin();
}
<input type="button" onclick="Search();">
Any help appreciated.