Page 1 of 1

textarea on single prompt field

Posted: Tue Jul 19, 2011 1:30 pm
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

Re: textarea on single prompt field

Posted: Tue Jul 19, 2011 1:47 pm
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>";

Re: textarea on single prompt field

Posted: Wed Jul 20, 2011 5:36 pm
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)

Re: textarea on single prompt field

Posted: Wed Jul 20, 2011 5:58 pm
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.

Re: textarea on single prompt field

Posted: Wed Jul 20, 2011 6:00 pm
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.

Re: textarea on single prompt field

Posted: Wed Jul 20, 2011 8:40 pm
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.

Re: textarea on single prompt field

Posted: Wed Jul 20, 2011 9:54 pm
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.