Announcement

Collapse
No announcement yet.

Radio buttons for ship to seperate address

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

    Radio buttons for ship to seperate address

    Hi, I'm trying to change the default check box in checkout page 00 to be Radio buttons. Using the code below it works fine Except that the customer can proceed without checking any buttons and the order progresses as though they had checked "NO".
    What I would like if poss is to make neither button pre-checked (as they are now) and if the customer does not check any an error message will tell them to choose YES or NO.
    ************************

    <actinic:block if="IsLocationInvoiceShipSeparately" >
    <tr>
    <td colspan="2"><Actinic:Variable Name="InvoicePrompt016"/></td>
    <td><input type="radio" <Actinic:Variable Name="InvoiceSeparateCheckStatus"/> name="SEPARATESHIP" value="YES" />YES
    <input type="Radio" <Actinic:Variable Name="InvoiceSeparateCheckStatus"/> name="SEPARATESHIP" value="" />NO</td>
    </tr>
    </actinic:block>

    *************************
    Many Thanks,
    Phil
    http://www.body-kit.co.uk

    #2
    Phil,

    I am checking to see if I can come up with something to run a validation on this and ask to input a value.

    Kind regards,
    Bruce King
    SellerDeck

    Comment


      #3
      Hi Phil

      The following worked for me on my default site.

      1. You will need to modify your existing Radio button codes to include an ID tag as well, so they now read as :
      <input type="radio" <Actinic:Variable Name="InvoiceSeparateCheckStatus"/> name="SEPARATESHIP" id="C1" value="YES" />YES
      <input type="Radio" <Actinic:Variable Name="InvoiceSeparateCheckStatus"/> name="SEPARATESHIP" id="C2" value="" />NO
      2. In the Design tab in Actinic, select CheckoutPage0 from the Select Page Type list, and navigate down to the Delivery Location layout.

      3. Add the followng function just after the above <input....> lines

      <script language=JavaScript>
      <!--
      function checkSepShip()
      {
      if ( document.getElementById('C1').checked == false && document.getElementById('C2').checked == false)
      {
      alert('Please select an option');
      return false;
      }
      return true;
      }
      // -->
      </script>
      Apply changes.

      4. Now click on the Next button in the preview to get to the Checkout Next Button layout. Replace the existing line with :
      <input type="submit" name="ACTION" value="<actinic:variable encoding="html" name="NextButton" />" onclick="return checkSepShip()"/>

      Apply and upload changes to the site. You should now have both the radio buttons de-selected and if you click Next, it will display the above alert (which you can modify), not letting the user proceed further.

      Hope this helps.
      Krithika Chandrasekar
      SellerDeck

      sigpic

      E-commerce software by SellerDeck

      Comment


        #4
        Excellent Krithika, thanks very much.
        Works perfectly.
        Cheers,
        Phil
        http://www.body-kit.co.uk

        Comment

        Working...
        X