an ASP.NET Open Source CMS & eCommerce platform
Search:
Skip Navigation LinksHome > DotShoppingCart Blog > Customization > Add a Terms Agreement Checkbox In The Checkout ...
Add a Terms Agreement Checkbox In The Checkout Page
In Store\OnePageCheckout.ascx add the following code after the line "<div><h3><asp:Literal runat="server" text="<%$ Resources:Common,ReviewInformationAndSubmitOrder %>" /></h3></div>"
 
 
<div>
    <asp:CheckBox id="chkTerms" runat="server" text="I have read and agree the your terms." />
    <asp:CustomValidator id="cvdAgree" runat="server" clientvalidationfunction="IsChecked"
        onservervalidate="cvdAgree_ServerValidate" validationgroup="checkout" errormessage="The term agreement must be checked.">*</asp:CustomValidator>
    <script type="text/javascript">
        function IsChecked(obj, args) {
            var checkbox = $("#<%= chkTerms.ClientID %>");
            args.IsValid = checkbox.attr('checked');
        }
    </script>
</div>
 
 
In Store\OnePageCheckout.ascx.cs add the following code
 
     protected void cvdAgree_ServerValidate(object source, ServerValidateEventArgs args) {
        args.IsValid = chkTerms.Checked;
    }
Recent Comments
danny jones said ...
Hi... I am inexperiance to build up ECommenrce type sites.I have a little bits knowladge ...
molakaj said ...
What a great approach to the subject, I was looking for. Thanks for these tips http://www ...
jane said ...
Thank you for this useful information.
furnace parts said ...
Congrats on V4.0.....It is so easy to use  
Travis said ...
I just bought DSC Suite V4.5 and it is more solid then ever. I hope I am #1 buyer of this ...