Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.
 function updatefeeall() {    
        var ctx = new SP.ClientContext.get_current();
        currentweb = ctx.get_web();
        this.list = currentweb.get_lists().getByTitle("ClubFeePattern");

        var query = SP.CamlQuery.createAllItemsQuery();
        this.allItems = list.getItems(query);
        ctx.load(allItems, 'Include(Title,Years,Amount,ID)');
        ctx.executeQueryAsync(Function.createDelegate(this, this.ExecuteOngetallSuccess),
                                   Function.createDelegate(this, this.ExecuteOngetallFailure));
    }

function OnValidate() {

    var chkAutoApproval = document.getElementById("<%=chkAutoApproval.ClientID %>");
    var txtSiteAccessToken = document.getElementById("<%=txtSiteAccessToken.ClientID %>");
    var txtSiteAccountId = document.getElementById("<%=txtSiteAccountId.ClientID %>");
    var accountTR = document.getElementById("<%= accountTR.ClientID %>");
    var ddlCategory = document.getElementById('<%=ddlClubCategory.ClientID%>');

    if (ddlCategory.options[ddlCategory.selectedIndex].value == '-- Select Club Category --') {
        alert("Please select the Category");
        return false;
    }

    if (chkAutoApproval.checked) {

        accountTR.style.visibility = "hidden";
        return true;
    }
    else {

        var valtxtSiteAccessToken = txtSiteAccessToken.value;
        var valtxtSiteAccountId = txtSiteAccountId.value;

        if ((valtxtSiteAccessToken != '' || valtxtSiteAccessToken.length > 0) && txtSiteAccountId.value == '') {
            alert("Please enter the WePay AccountID.");
            return false;
        }
        if (txtSiteAccessToken.value == '' && txtSiteAccountId.value != '') {

            alert("Please enter the WePay AccessToken.");
            return false;
        }


    }
    return updatefeeall();
}
share|improve this question
    
How do you bind handler for button? –  Alexander Dec 24 '12 at 8:51
    
here is my code <asp:Button ID="btnSave" runat="server" OnClientClick="return OnValidate();" CssClass="buttongroup" Width="80px" Text="Save" OnClick="btnSave_Click" CausesValidation="true" ValidationGroup="Submit" /> –  Rajesh Chowdary Dec 24 '12 at 8:54
    
how do you invoke updatefeeall function? –  Alexander Dec 24 '12 at 8:56
    
in OnValidate function i am calling the updatefeeall() method –  Rajesh Chowdary Dec 24 '12 at 8:56
    
In IE its working fine problem in other major browsers –  Rajesh Chowdary Dec 24 '12 at 8:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.