jquery bind click event
- by Adem
I am having a problem with my code
if (text.length < 1)
{
args.IsValid = false;
$('#<% = cmdSaveRequest.ClientID()> %>').removeAttr('click'());
}
else
{
$('#<% = cmdSaveRequest.ClientID()> %>').click(savingData());
args.IsValid = true;
}
when I assign click event like
$('#<% = cmdSaveRequest.ClientID()
%').click(savingData());
it executes the saving data function
Is there any way to bind the click event to button but whiteout executing the function just bind it and after user clicks the button then the function executes?