Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / pre filled text area

pre filled text area

Locked

Views: 4,319

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
16 Nov 2009, 12:06 PM
#1
flashy275 avatar

flashy275

New Zenner

Join Date:
Sep 2009
Posts:
55
Plugin Contributions:
0

pre filled text area

Hi all,

I am trying to pre fill a text area box with info to assist the customer with what to put in there. The idea being similar to a drop down box which might by default say "please make a selection". The text box in question is on "delivery info" page 1 of 3 on checkout, the file I've accessed is tpl_checkout_shipping_default.php line 126. Not sure if this possible, has anyone tried to do this before?

16 Nov 2009, 12:57 PM
#2
jcdk avatar

jcdk

Zen Follower

Join Date:
Oct 2009
Location:
Netherlands - NB
Posts:
144
Plugin Contributions:
0

Re: pre filled text area

flashy275:

Hi all,

I am trying to pre fill a text area box with info to assist the customer with what to put in there. The idea being similar to a drop down box which might by default say "please make a selection". The text box in question is on "delivery info" page 1 of 3 on checkout, the file I've accessed is tpl_checkout_shipping_default.php line 126. Not sure if this possible, has anyone tried to do this before?

I am not sure if I get you right, but I guess you should add a simple html text area in your tpl file.

Like this:

<TEXTAREA NAME="comments" COLS=40 ROWS=6> John said : I think it's a great idea : but it needs more thought </TEXTAREA>TEXTAREA>

you can also include a value="your text"/> in it.

16 Nov 2009, 3:20 PM
#3
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: pre filled text area

NOTE: if you go to the Option Name Manager and EDIT the Option Name, there is a Comment area that you can use ...

16 Nov 2009, 6:13 PM
#4
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: pre filled text area

flashy275:

Hi all,

I am trying to pre fill a text area box with info to assist the customer with what to put in there. The idea being similar to a drop down box which might by default say "please make a selection". The text box in question is on "delivery info" page 1 of 3 on checkout, the file I've accessed is tpl_checkout_shipping_default.php line 126. Not sure if this possible, has anyone tried to do this before?

Here is the line of code you are referring to: You can add the highlighted portion to pre fill the comment box.

<?php echo zen_draw_textarea_field('comments', '45', '3', 'You may add any comments about your order here'); ?>
17 Nov 2009, 9:25 AM
#5
flashy275 avatar

flashy275

New Zenner

Join Date:
Sep 2009
Posts:
55
Plugin Contributions:
0

Re: pre filled text area

great help thanks,

jcdk pointed me in the right direction and after playing around a little from there I produced the required result exactly as Clyde suggested.

thanks again

11 Jan 2010, 8:41 AM
#6
colinvic avatar

colinvic

New Zenner

Join Date:
Jan 2010
Posts:
9
Plugin Contributions:
0

Re: pre filled text area

Hi,
I've come across a similar scenario and will try explain as easily as possible. In the attributes section, the text option allows the custmer to enter some custom text to their order. i would like to prefill this with a bit of text to give customers an idea of what to put in here. I know to edit option names and comments and use multiple lines, but i just cant seem to add in a bit of text in this blank area, with the text disappearing when they click to type in their own text. This is Zen Cart, i'm surprised to have not been able to find this in the forum. To give you an idea, when you want to reply to a message on this thread, their is text in the box already saying 'Please click...." Anybody?

14 Jan 2010, 12:32 AM
#7
colinvic avatar

colinvic

New Zenner

Join Date:
Jan 2010
Posts:
9
Plugin Contributions:
0

Re: pre filled text area

colinvic:

Hi,
I've come across a similar scenario and will try explain as easily as possible. In the attributes section, the text option allows the custmer to enter some custom text to their order. i would like to prefill this with a bit of text to give customers an idea of what to put in here. I know to edit option names and comments and use multiple lines, but i just cant seem to add in a bit of text in this blank area, with the text disappearing when they click to type in their own text. This is Zen Cart, i'm surprised to have not been able to find this in the forum. To give you an idea, when you want to reply to a message on this thread, their is text in the box already saying 'Please click...." Anybody?

The threads in this section are very helpful as far as i should be able to work out how to do it, but does anyone know the file i should be looking at? cheers

30 Jan 2010, 7:40 PM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: pre filled text area

Could you give an example of what you need to pre-populate the comment with?

If you were to do a search in the Tools ... Developers Tool Kit ... on a portion of the line that clydejones post in the bottom input box for:

zen_draw_textarea_field('comments'

You will find it is referenced in a few files, the first one in the checkout being:

/includes/templates/template_default/templates/tpl_checkout_shipping_default.php

Line #136 : <?php echo zen_draw_textarea_field('comments', '45', '3'); ?>

The extra paramater added to the code would default it to the text to be added to this line ...

NOTE: you should use your templates and overrides directory for these changes ...

24 Feb 2010, 12:48 PM
#9
colinvic avatar

colinvic

New Zenner

Join Date:
Jan 2010
Posts:
9
Plugin Contributions:
0

Re: pre filled text area

Ajeh:

Could you give an example of what you need to pre-populate the comment with?

If you were to do a search in the Tools ... Developers Tool Kit ... on a portion of the line that clydejones post in the bottom input box for:

You will find it is referenced in a few files, the first one in the checkout being:

The extra paramater added to the code would default it to the text to be added to this line ...

NOTE: you should use your templates and overrides directory for these changes ...

I have attached a link to better explain. In the Engraving attribute i would like it (in the cuurently blank space) to be prefilled to say what i have listed in the Example underneath it. When they click there to type the example text disappears. Is this possible? Direct Link below. Thanks

http://www.moderntrophies.com.au/index.php?main_page=product_info&cPath=61_58_80&products_id=234