C# .NET - javascript onclient click fires but onclick doesnt

Asked By karur krishna madhu on 02-Sep-13 11:18 AM
my js function

//Validate Draft request, get confirmation 
function validateDraftRequest() {


    // checking the sales oriented value is null or not.
    if (document.getElementById('rdoRC1').checked == true) {
        if (trim(document.getElementById('txtCustCompany').value) == "")
            alert("Please enter the Customer/Company name");
        return false;
    }
    // checking the Event oriented value is null or not.
    if (document.getElementById('rdoRC2').checked == true) {
        if (trim(document.getElementById('txtEventname').value) == "")
            alert("Please enter the Event name");
        return false;
    }
   else
    return true;
}

 <asp:Button ID="btnDraft" runat="server" Text="Save as Draft" OnClick="btnDraft_Click" OnClientClick ="return validateDraftRequest();"/>

 i have tried removing return, onblur and also used submit behaviour=false. still the onclick doesnt fire after js returns true.any suggestion is appreciated.
Ramendra Kumar replied to karur krishna madhu on 02-Sep-13 08:57 AM
onclick used for html controls , where as you have a server button so you need to call onClientClick="alert('ff');"
let me know what happens
karur krishna madhu replied to Ramendra Kumar on 10-Sep-13 10:40 PM
still it doesnt work on client click works then on click doesnt