This is a migrated thread and some comments may be shown as answers.

RadButton OnClientClicked occurs on Page_Load

1 Answer 167 Views
Button
This is a migrated thread and some comments may be shown as answers.
Lynn
Top achievements
Rank 2
Lynn asked on 25 Dec 2014, 03:06 PM
I have having a consistently wrong issue with the RadButton...When the web form is loaded, the OnClientClicked event is executing but the JavaScript fails because it can't find the function.  This is actually two (2) errors -- first the OnClientClicked event should NOT be firing and second, the javascript function it appears to be looking for is present in the code.

I have read other similar threads and they all say to remove the () after the function name in the OnClientClicked event property -- but I have done that repeatedly.  The button definition, the javascript function, and a screen capture of the javascript error are all included.
<telerik:RadButton ID="CreateNew" runat="server" Text="Create New" CausesValidation="False" ToolTip="Displays a form for adding a new Master Agent Billing set to the database." UseSubmitBehavior="false" OnClick="CreateNew_Click" OnClientClicked="makeNew" />


function makeNew(sender, eventArgs) {
 
    document.getElementById('<%= HiddenField1.ClientID%>').value = "myTarget;
    document.getElementById('<%= K.ClientID%>').value = "0";
    document.getElementById('<%= KI.ClientID%>').value = "0";
    document.getElementById('<%= KII.ClientID%>').value = "0";
    document.getElementById('<%= M.ClientID%>').value = "N";
    document.getElementById('<%= MI.ClientID%>').value = "N";
    document.getElementById('<%= MII.ClientID%>').value = "N";
 
    document.forms["form1"].submit();
 
}




1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 26 Dec 2014, 11:18 AM
Hello Lynn,

This question seems related to your previously opened thread (RadButton OnClientClicked Firing on Page_Load), let us continue the conversation there.

Regards,
Ianko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Button
Asked by
Lynn
Top achievements
Rank 2
Answers by
Ianko
Telerik team
Share this question
or