adsense

Tuesday, October 23, 2012

Working with button OnClick() and OnClientClick()

When we want to check some client side validation on a buttons' click  OnClientClick() comes to your assistance. But it seems that using OnClick() and OnClientClick() events at the same time bit tricky.

I have tried following ways, but none of them worked..!!

OnClientClick="return ValidateFunciton();" OnClientClick="if(ValidateFunciton()) return true;"
OnClientClick="ValidateFunciton();"
 
But following worked for me
 
<asp:Button ID="btnSearch" runat="server" Text="Search"  
OnClick="btbSearch_Click" 
OnClientClick="if (!ValidateFunciton()) { return false;};" />
Cheers
Samitha
 
 

No comments:

Post a Comment