I have a rad button which implements the single click solutoin provided by Telerik to pervent multiple submissions.
My declaration is:
And I have a handler for the OnClientClicked Event:
When I click on the button, everything works as expected. However, in some instances, I would like to induce the button click and have it do exactly the same from some client-side code. When I call the button.click function client-side I have noticed that the cliked handler does fire, but the postback never occurs. I am guessing this has something to do with the removal of the postback behavior in the button which is necessary to prevent the double click. Is there a way to make the button do the same thing whether you click on it or call button.click client-side?
My declaration is:
<
telerik:RadButton
ID
=
"btnFind"
runat
=
"server"
Text
=
"Find Visits"
style
=
"margin:7px;"
UseSubmitBehavior
=
"false"
OnClientClicked
=
"FindClickedHandler_VFC"
>
<
Icon
PrimaryIconUrl
=
"~/global/images/icons/search.png"
/>
</
telerik:RadButton
>
And I have a handler for the OnClientClicked Event:
function
FindClickedHandler_VFC(sender, eventArgs) {
var
validated = Page_ClientValidate(
'val'
);
if
(!validated) {
return
;
}
else
{
sender.set_enabled(
false
);
if
(sender.get_text() ==
"Search"
) sender.set_text(
"Searching..."
);
}
}
When I click on the button, everything works as expected. However, in some instances, I would like to induce the button click and have it do exactly the same from some client-side code. When I call the button.click function client-side I have noticed that the cliked handler does fire, but the postback never occurs. I am guessing this has something to do with the removal of the postback behavior in the button which is necessary to prevent the double click. Is there a way to make the button do the same thing whether you click on it or call button.click client-side?