Page 1 of 1

Email list checkbox checked by default at checkout...

Posted: Fri Jul 05, 2013 11:15 am
by crazyjoe
I need to make it so my email list signup checkbox is checked by default on my OnePageCheckout. Can someone tell me how I should append this code so it is checked by default...

Code: Select all

                                    <asp:PlaceHolder ID="EmailListPanel" runat="server" EnableViewState="false">
                                        <asp:DataList ID="EmailLists" runat="server" EnableViewState="false">
                                            <ItemTemplate>
                                               <asp:CheckBox ID="Selected"  runat="server" Checked="<%#IsEmailListChecked(Container.DataItem)%>" EnableViewState="false" Enabled="true" />
                                                <%#Eval("Name")%><br />
                                                <%#Eval("Description")%><br />
                                            </ItemTemplate>
                                        </asp:DataList>
                                    </asp:PlaceHolder>
Thanks in advance :-)

Re: Email list checkbox checked by default at checkout...

Posted: Tue Jul 23, 2013 8:41 am
by crazyjoe
Can anybody help out with this?

Re: Email list checkbox checked by default at checkout...

Posted: Mon Aug 05, 2013 11:43 am
by deverill
To make a checkbox checked you can say:

Code: Select all

<asp:CheckBox ID="Selected"  runat="server" Checked="true" EnableViewState="false" Enabled="true" />
but the part in the original that says:

Code: Select all

<%#IsEmailListChecked(Container.DataItem)%>
is calling a function in your OnePageCheckout.ascx.cs file named IsEmailListChecked() to see if it should be checked.

This mod may do what you want but there may be underlying settings this does not address. I've not really dug into what it's doing but I felt bad that your request was a month old without an answer so take it for what it's worth.

Jim

Re: Email list checkbox checked by default at checkout...

Posted: Mon Aug 12, 2013 2:15 pm
by crazyjoe
Thanks for the reply Jim. I caved and paid a professional to do it. Something needs to be added in the .cs I'm guessing. You can't just replace the code with "true" because that code is what actually tells the cart to add the address to my list. When I tested it, the check box was checked, but the address wasn't saved into my database. I appreciate your help, we need more guys like you wonderin' this board :-)