Announcement

Collapse
No announcement yet.

Optional textarea input

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

    Optional textarea input

    Following on from a request by Norman I am posting this on the general Actinic forum rather than his Drillpine forum as it is a bit more general and of use to others if a fix is found than his multi other input tweak.

    The standard input prompt can be set to a <textarea> via text id 2161 in the AUG - this is fine but is non-optional. Is there a way to make the input an optional field?

    We have tried combining Normans plug-in with a tweak to create a single <textarea> but this then becomes a required field.

    v9 site but same for v8 and v10 should imagine.


    Bikster
    SellerDeck Designs and Responsive Themes

    #2
    Do the AUG or KB tweak as mentioned above. Once done, re-edit ActinicOrder.pm and look for:
    Code:
    if (length $sInfo == 0)							# if there is no info, reprompt
    Replace with:
    Code:
    if (0)							# if there is no info, ignore
    Now Actinic will allow empty responses to all Other Info questions.

    If you want to make this controllable then replacing the above with (untested):
    Code:
    if ( ($sPrompt !~ /:/) && (length $sInfo == 0) )		# if there is no info for prompt not containing ":", reprompt
    Will now allow you to make the other info optional or mandatory depending on whether the Other Info Prompt contains a ":" character or not.

    E.g. Prompts like:- You may enter text here:
    Or:- You must enter text here.

    Updated 29-07-11 to reverse purpose of ":" and make it the optional trigger.
    Norman - www.drillpine.biz
    Edinburgh, U K / Bitez, Turkey

    Comment


      #3
      That was a lot less painless than was expecting - god bless your encyclopaedic knowledge of Actinic perl scripts.

      Thanks Norman.

      One for the KB / AUG for sure

      In future releases maybe a simple switch next to the other info prompt if this is to me optional / mandatory would be a simple yet great benefit.


      Bikster
      SellerDeck Designs and Responsive Themes

      Comment


        #4
        Did it work?

        If so did you try my later suggestion that lets you make it mandatory / optional on request.

        If I know it worked as expected, I'll be able to remove the (untested) from my post.
        Norman - www.drillpine.biz
        Edinburgh, U K / Bitez, Turkey

        Comment


          #5
          Been meaning to report back.... yes, combining the KB hack on 2161 with your tweak created an optional <textarea>. I have not tried the the switch option yet though.

          The only issue is if the prompt is left blank it passes a blank <textarea> through to the cart which may confuse users.


          Bikster
          SellerDeck Designs and Responsive Themes

          Comment


            #6
            That blank textarea is probably OK. The usual behaviour of the Other Info prompt is to be editable in the Cart. It would make sense to have the Textarea editable too. And I guess this includes adding something to an empty entry, or deleting an existing entry. Prompts like "Optional inscription" would keep the customer informed.
            Norman - www.drillpine.biz
            Edinburgh, U K / Bitez, Turkey

            Comment

            Working...
            X