Announcement

Collapse
No announcement yet.

Visible and required fields for account customers only

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

    Visible and required fields for account customers only

    I need to have a field for account customers only to add a Purchase Order number. This field need to be visible and required for account customers, but invisible and therefore not required for all other customers.

    I've used the General User Definable 1 field for this purpose, and have hidden it from non-account customers with a NOTINB2B tag as follows:


    <Actinic:NOTINB2B><!--</Actinic:NOTINB2B>
    <span class="actregular"><b><Actinic:Variable Name="GeneralTitle"/></b></span>
    <br /><br />
    <table border="0" width="<actinic:variable name="ACTSTDWIDTH" />" cellspacing="2" cellpadding="3" class="checkout">
    <actinic:variable name="CheckoutPrompt" value="General User Definable 1" if="%3cactinic%3avariable%20name%3d%22GeneralPrompt000Visible%22%20%2f%3e" />
    <actinic:variable name="CheckoutPrompt" value="General User Definable 2" if="%3cactinic%3avariable%20name%3d%22GeneralPrompt001Visible%22%20%2f%3e" />
    <actinic:variable name="CheckoutPrompt" value="General User Definable 3" if="%3cactinic%3avariable%20name%3d%22GeneralPrompt002Visible%22%20%2f%3e" />
    </table>
    <br />
    <hr size="1" width="<actinic:variable name="ACTSTDWIDTH" />" align="left" />
    <Actinic:NOTINB2B>--></Actinic:NOTINB2B>

    However, there's still a problem. If I select General User Definable 1 as a required field in Design\Text, it becomes required for both account customers and non-account customers - with the result that non-account customers are not able to proceed as they haven't filled in a required field that is invisible to them!

    Is there any way to make User Definable 1 visible ONLY to account customers, and also to make it a required field ONLY for account customers?

    Suggestions gratefully received!

    #2
    Hello Richard

    I shall pass this dilemma onto our third line support, and will let you know their findings as soon as possible.

    Thanks

    Chris

    Comment


      #3
      Thanks Chris, appreciate it.

      Richard

      Comment


        #4
        Originally posted by Christopher J View Post
        Hello Richard

        I shall pass this dilemma onto our third line support, and will let you know their findings as soon as possible.

        Thanks

        Chris
        Chris

        Any more thoughts on the matter of making the PO both hidden and required for account customers?

        Richard

        Comment


          #5
          could you just not set the value to "0"?
          So for non account customers they don't see the field and is set to 0, and for account customers they can see the field and change the 0 to what ever they need?

          I don't think there is any easy way to doing it, as it would need some modification to the perl scripts as when you tick 'required' that is where it is controlled
          "If my answers frighten you then you should cease asking scary questions"

          Comment


            #6
            Sounds like a good idea, but I can't seem to change the default value for some reason - the 'Default value' box is greyed out and can't be overwritten. Am I missing something?

            Comment


              #7
              why don't you hard code it?

              but just realised that this defeats what you are trying to do, so its not worth the hassle.
              "If my answers frighten you then you should cease asking scary questions"

              Comment


                #8
                You were along the right lines. Just need a bit extra

                Using the standard PONO field, set to be visible and required in Design > Text > Website Continued > Payment Details

                In the Library, find Payment Purchase Order Number Layout and replace contents with

                Code:
                <Actinic:NOTINB2B><!--</Actinic:NOTINB2B>
                
                <tr>
                   <td>
                      <actinic:block if="%3cactinic%3avariable%20name%3d%22PaymentPrompt006Required%22%20%2f%3e"><span class="actrequired"></actinic:block>   
                         <Actinic:Variable Name="PaymentPrompt006"/>
                      <actinic:block if="%3cactinic%3avariable%20name%3d%22PaymentPrompt006Required%22%20%2f%3e">*</span></actinic:block>
                   </td>
                   <td>
                	<input type="text" name="PAYMENTPONO" size="15" maxlength="255" value="<Actinic:Variable Name="PaymentPONO"/><Actinic:NOTINB2B>N/A</Actinic:NOTINB2B>">
                    </td>
                </tr>
                
                <Actinic:NOTINB2B>--></Actinic:NOTINB2B>
                	<Actinic:NOTINB2B><input type="hidden" name="PAYMENTPONO" size="15" maxlength="255" value="WIBBLE"></Actinic:NOTINB2B>
                This will show the field for registered customers and hide if from unregistered customers. For unregistered customers the value N/A will be saved to the order. NB won't work if you compact your HTML in Design > Design Options.

                Comment


                  #9
                  Ah, easy when you know what's available.
                  Nice one Jon
                  "If my answers frighten you then you should cease asking scary questions"

                  Comment

                  Working...
                  X