Announcement

Collapse
No announcement yet.

Mandatory radio button option in checkout

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Mandatory radio button option in checkout

    I want to add another option to my checkout, below the terms & conditions tick box. It will be a declaration ("I am over 18" for example, or "I am a business customer" for a b2b only site).

    I can add another tick box by using the 'user defined' option in [design/text/website(cont)/invoice address]. However, a tick box would be no good from a 'legal declaration' point of view because they can just leave it at the default, and then later claim they were the 'other option' but didn't change the option at the time because they didn't see it.

    I guess what I need is 2 choices (ie. "I am under 18"/"I am 18 or over"), neither of which is selected by default (otherwise again they can later claim they didn't see it and just pressed continue, 'accidently' selecting the default)

    So this has to be 'choose one or the other' - if neither is chosen the cart will just error in the same way it does if they don't tick the mandatory 'i accept the t&c' option.

    So I'm guessing I would have to use radio buttons, but with no default set. How can I change the "user definable" from a check box to radio buttons? (I'm assuming the code is hidden away in design/text somewhere)
    John

    #2
    Hi John,

    I've just tried the following which seems to work:

    - go to 'Advanced | Template Manager | Ordering tab (click 'Change View' if you do not see the tabs)
    - click on the 'OrderPhase1' button to edit the template (Act_Order01.html - you may want to back up the template before making changes)
    - search for 'NEQUOTEVAR:INVOICEUSERDEFINED'
    - you should see:

    Code:
    <INPUT TYPE="TEXT" NAME="INVOICEUSERDEFINED" SIZE="20" MAXLENGTH="255" VALUE="NETQUOTEVAR:INVOICEUSERDEFINED">
    - replace this with:

    Code:
    <input type="radio" id="under18" name="INVOICEUSERDEFINED" size="20" maxlength="255" value="below 18">under 18<br/>
    	<input type="radio" id="over18" name="INVOICEUSERDEFINED" size="20" maxlength="255" value="over 18">over 18
    <script language=JavaScript>
    <!--
    function checkage()
      {
      if ( !document.getElementById('under18').checked && !document.getElementById('over18').checked )
        {
        alert('please select if you are over 18 or not');
        return false;
        }
    return true;
    }
    // -->
    </script>
    - then search for 'NETQUOTEVAR:NEXTBUTTON'
    - you should see:

    Code:
    <INPUT TYPE=SUBMIT NAME=ACTION VALUE="NETQUOTEVAR:NEXTBUTTON">
    - change this to:

    Code:
    <input type=SUBMIT name=ACTION value="NETQUOTEVAR:NEXTBUTTON" onclick="return checkage()" />
    - close and save the file and update your site and test it out.
    ********************
    Tracey
    SellerDeck

    Comment


      #3
      ok, that seems to work fine - except.... I already had a
      Code:
      onclick="return xxxxx()" />
      at the end of the 'next button' line.

      It's a small procedure that tells hotmailers and yahoos to enter a proper email address. So is it possible to call 2 procedures 'onclick'? Or can it worked around by calling one procedure that then calls the other one when finished...?
      John

      Comment


        #4
        Try:

        Code:
        onclick="xxxxx(); return checkage();" />
        ********************
        Tracey
        SellerDeck

        Comment


          #5
          Actually, it seems that this bit is not required...

          return checkage();"
          I deleted that from the next button line while testing the 2 'onclick' functions, and it seems to work just fine without it. Possibly, because the 'user defined' field is set to mandatory in options/text actinic is handling the bit that makes sure the user selects one...?
          John

          Comment


            #6
            in fact none of this is required at all -

            <script language=JavaScript>
            <!--
            function checkb2b()
            {
            if ( !document.getElementById('myconsumer').checked && !document.getElementById('mybusiness').checked )
            {
            alert('please select if you are purchasing as a business or consumer');
            return false;
            }
            return true;
            }
            // -->
            </script>
            just replacing that one line with the 2 radio button lines seems to work just fine! (as far as I can tell)
            John

            Comment

            Working...
            X