textarea on single prompt field

Collect several lines of customer entered data with a product.
Post Reply
jont
Posts: 12
Joined: Sun Sep 07, 2008 10:18 am

textarea on single prompt field

Post by jont »

I have a v9 site which uses the standard <textarea> hack for a larger input field - but this is non optional. I am looking at combining your multi prompt to give the option tweak but have a single <textarea> input as this suits the requirements of the products better (personalised cards).

Looking in actiniccore.js I see

Code: Select all

document.write(pre + '<INPUT TYPE=text NAME="O_' + prodref + '" ' + prodvalue + ' SIZE="' + size + '" MAXLENGTH="' + max 
                     + '" onchange="stripspecial(\'O_' + prodref + '\')">');
which changing to <textarea> brings up a lot of HTML in the input area. The text id in Actinic was hacked for the <textarea> input so that may be adding to the issue
norman
Site Admin
Posts: 1252
Joined: Sat Feb 07, 2004 9:55 pm

Re: textarea on single prompt field

Post by norman »

Very difficult to get both Multi Other Info and some TEXTAREAS on the same site, I think, as this is a very complex add-on. Easier not to try and just stick with the simpler TEXTAREA tweak.

If you want to press on:-

Look in the tweaked actiniccore.js for the JavaScript lines:

Code: Select all

  document.write(pre + '<INPUT TYPE=text NAME="O_' + prodref + '" ' + prodvalue + ' SIZE="' + size + '" MAXLENGTH="' + max 
                     + '" onchange="stripspecial(\'O_' + prodref + '\')">');
This is what creates the standard other info code, if the Prompt doesn't contain "|" to signify more than one field is required.

You could change it to generate a TEXTAREA instead.

My guess (untested) is that you'd need:

Code: Select all

  document.write(pre + '<textarea name="O_' + prodref + '" cols="20" rows="3" onchange="stripspecial(\'O_' + prodref + '\')"></textarea>');
And something similar would need doing (now in Perl) in ActinicOrder.pm to the lines:

Code: Select all

			$sHTML = "<INPUT TYPE=TEXT SIZE=\"35\" NAME=\"O_$nIndex\" VALUE=\"$sValue\"";
                        $sHTML .= " onchange=\"stripspecial('O_$nIndex')\" $sStyle>";
Change to (untested):

Code: Select all

			$sHTML = "<textarea NAME=\"O_$nIndex\" onchange=\"stripspecial('O_$nIndex')\">$sValue</textarea>";
Norman
jont
Posts: 12
Joined: Sun Sep 07, 2008 10:18 am

Re: textarea on single prompt field

Post by jont »

Thanks Norman - that created the text area and passes through to the cart (with HTML) but it is no longer optional

Test upload to http://bikster-websites2.co.uk/cool/aca ... ter99.html if it helps (v9)
norman
Site Admin
Posts: 1252
Joined: Sat Feb 07, 2004 9:55 pm

Re: textarea on single prompt field

Post by norman »

You'd have to merge the optional code for the Textarea with the modified ActinicOrder.pm that Multi Other Info Uses.

I'd need to know where you got the Textarea tweak from to comment further.
Norman
norman
Site Admin
Posts: 1252
Joined: Sat Feb 07, 2004 9:55 pm

Re: textarea on single prompt field

Post by norman »

Update: Are you really after a Textarea but want to make it optional? No need for Multi other Info and all its complexity then.
Norman
jont
Posts: 12
Joined: Sun Sep 07, 2008 10:18 am

Re: textarea on single prompt field

Post by jont »

Yes - a text area that will sit against each product but is optional.

The site has an existing Actinic text area tweak from text id 2161 but as a standalone product. This was messy as really needs to be against each product (to save clicking extra products to personalise) but it needs to be optional as not all cards will be personalised.
norman
Site Admin
Posts: 1252
Joined: Sat Feb 07, 2004 9:55 pm

Re: textarea on single prompt field

Post by norman »

Since this is now a general Actinic tweak, could you repost on the Community with link to the tweak you are using.

I'll find a way to then make it optional. And hopefully it'll be of use to others there.
Norman
Post Reply