multiple input text fields

General ShopSite user discussion

multiple input text fields

Postby Pam Laing » Sat Jul 22, 2006 4:07 pm

Does anyone know how to have multiple input text fields for products and get
them into the one text field allowed? I am not a javascript writer and have
been told it can be done, but don't know where to start.

The site is www.smallfrypress.net -- I have customized the page and product
templates which went fine. Just need the multiple input fields.

Thanks for any help anyone can provide!

Pam
Pam Laing
 

Re: multiple input text fields

Postby jim » Sat Jul 22, 2006 7:29 pm

In your product template you would put something like this:
----------------------------
<form action="[-- SHOPPING_CART_URL BASE --]/order.cgi" method=post>
<input type=hidden name=storeid value=[-- STORE_ID --]>
<input type=hidden name=dbname value=products>
<input type=hidden name=function value=add>
<input type=hidden name=itemnum value=[-- PRODUCT.RecordNumber --]>
[-- IF PRODUCT.DisplayOrderingOptions --]
<br>[-- PRODUCT.OptionText --]
[-- ORDER_OPTION_MENU LINE --]
[-- END_IF --]

[-- IF PRODUCT.OptionsBox --]

Name: <textarea name="[-- PRODUCT.Recordnumber --]:freeopt">
</textarea><br>
Address: <textarea name="[-- PRODUCT.Recordnumber --]:freeopt">
</textarea><br>
City: Name: <textarea name="[-- PRODUCT.Recordnumber --]:freeopt">
</textarea><br>
State: Name: <textarea name="[-- PRODUCT.Recordnumber
--]:freeopt"> </textarea><br>
Zip: Name: <textarea name="[-- PRODUCT.Recordnumber --]:freeopt">
</textarea><br>

[-- END_IF --]

<input type=image src="[-- OUTPUT_DIRECTORY_URL
--]/media/button_add.gif" border=0 name="Add to Cart" alt="Add to Cart">
</form>
---------------------------
Note all the Text area lines. When this is displayed on the page there
will be a separate input field for each. When they are added to the
shopping cart they will all be put in the single field for the product
with a comma between each entry . You would need to sort out what the
shopper entered based on the commas. So it would look like this:
My Name, 283 N. Main, Any town, AnyState, 12345

You could include a separator between fields by putting something like
this between each of the textarea lines
<input type=hidden name="[-- PRODUCT.Recordnumber --]:freeopt"
value=";">

But that would display as
My Name,;, 283 N. Main,;, Any town,;, AnyState,;, 12345
In the shopping cart and the shopper might wonder what all of the ,;,
characters in the text were.

I have seen a store where they have a button that pops open a dialog
with different input fields from the shopping cart screen . The shopper
fills in their information on that screen and it is passed back to the
form field for the product in the cart. I'm sure this requires
javascript but I don't know how it was done.

Note that the textarea could be any type of input so you could have a
single line input by using
<input type=text name="[-- PRODUCT.Recordnumber --]:freeopt" size=50 >

Jim




Pam Laing wrote:
Does anyone know how to have multiple input text fields for products and get
them into the one text field allowed? I am not a javascript writer and have
been told it can be done, but don't know where to start.

The site is www.smallfrypress.net -- I have customized the page and product
templates which went fine. Just need the multiple input fields.

Thanks for any help anyone can provide!

Pam

jim
 

Re: multiple input text fields

Postby Pam Laing » Sun Jul 23, 2006 4:45 pm

Thanks so much for your help! I will try that this evening.

Do you know if there is a way to do it such that only one template is used
for all products so, if the extra fields are needed for input, it is somehow
associated with the product thus not requiring different templates for
different products?

My concern is if I have too many templates, I will forget to update parts in
one and not the others (if there is a change). Unless I'm not seeing the
best way to set up the product templates. Maybe you have a good suggestion?

"jim" <jstavast@xmission.com> wrote in message
news:e9umt2$2or$1@eval.shopsite.com...
In your product template you would put something like this:
----------------------------
form action="[-- SHOPPING_CART_URL BASE --]/order.cgi" method=post
input type=hidden name=storeid value=[-- STORE_ID --]
input type=hidden name=dbname value=products
input type=hidden name=function value=add
input type=hidden name=itemnum value=[-- PRODUCT.RecordNumber --]
[-- IF PRODUCT.DisplayOrderingOptions --]
br>[-- PRODUCT.OptionText --]
[-- ORDER_OPTION_MENU LINE --]
[-- END_IF --]

[-- IF PRODUCT.OptionsBox --]

Name: <textarea name="[-- PRODUCT.Recordnumber --]:freeopt"
/textarea><br
Address: <textarea name="[-- PRODUCT.Recordnumber --]:freeopt"
/textarea><br
City: Name: <textarea name="[-- PRODUCT.Recordnumber --]:freeopt"
/textarea><br
State: Name: <textarea name="[-- PRODUCT.Recordnumber --]:freeopt"
/textarea><br
Zip: Name: <textarea name="[-- PRODUCT.Recordnumber --]:freeopt"
/textarea><br

[-- END_IF --]

input type=image src="[--
OUTPUT_DIRECTORY_URL --]/media/button_add.gif" border=0 name="Add to Cart"
alt="Add to Cart"
/form
---------------------------
Note all the Text area lines. When this is displayed on the page there
will be a separate input field for each. When they are added to the
shopping cart they will all be put in the single field for the product
with a comma between each entry . You would need to sort out what the
shopper entered based on the commas. So it would look like this:
My Name, 283 N. Main, Any town, AnyState, 12345

You could include a separator between fields by putting something like
this between each of the textarea lines
input type=hidden name="[-- PRODUCT.Recordnumber --]:freeopt"
value=";"

But that would display as
My Name,;, 283 N. Main,;, Any town,;, AnyState,;, 12345
In the shopping cart and the shopper might wonder what all of the ,;,
characters in the text were.

I have seen a store where they have a button that pops open a dialog with
different input fields from the shopping cart screen . The shopper fills
in their information on that screen and it is passed back to the form
field for the product in the cart. I'm sure this requires javascript but
I don't know how it was done.

Note that the textarea could be any type of input so you could have a
single line input by using
input type=text name="[-- PRODUCT.Recordnumber --]:freeopt" size=50

Jim




Pam Laing wrote:
Does anyone know how to have multiple input text fields for products and
get them into the one text field allowed? I am not a javascript writer
and have been told it can be done, but don't know where to start.

The site is www.smallfrypress.net -- I have customized the page and
product templates which went fine. Just need the multiple input fields.

Thanks for any help anyone can provide!

Pam
Pam Laing
 

Re: multiple input text fields

Postby Jim » Tue Jul 25, 2006 7:38 am

The template code I gave checks to see if the Product Info field
"Customer Text Entry:" is checked or not (i.e. [-- IF PRODUCT.OptionsBox
--]), if it is checked then the the text input fields will be displayed
if it isn't then they won't. So a single template could be used for all
products and those with the box checked will display the field and
others won.t.

There is no way to specify only certain fields (e.g. Name and street
address but not city state zip) at a time though without having a
separate template for each different group of fields that you need. You
could perhaps use one of the Custom fields (Pro store only) to determine
what fields need to be displayed and then in your template use IF - THEN
logic to determine which fields to display. This is more complicated
but possible.

Jim

Pam Laing wrote:
Thanks so much for your help! I will try that this evening.

Do you know if there is a way to do it such that only one template is used
for all products so, if the extra fields are needed for input, it is somehow
associated with the product thus not requiring different templates for
different products?

My concern is if I have too many templates, I will forget to update parts in
one and not the others (if there is a change). Unless I'm not seeing the
best way to set up the product templates. Maybe you have a good suggestion?

"jim" <jstavast@xmission.com> wrote in message
news:e9umt2$2or$1@eval.shopsite.com...
In your product template you would put something like this:
----------------------------
form action="[-- SHOPPING_CART_URL BASE --]/order.cgi" method=post
input type=hidden name=storeid value=[-- STORE_ID --]
input type=hidden name=dbname value=products
input type=hidden name=function value=add
input type=hidden name=itemnum value=[-- PRODUCT.RecordNumber --]
[-- IF PRODUCT.DisplayOrderingOptions --]
br>[-- PRODUCT.OptionText --]
[-- ORDER_OPTION_MENU LINE --]
[-- END_IF --]

[-- IF PRODUCT.OptionsBox --]

Name: <textarea name="[-- PRODUCT.Recordnumber --]:freeopt"
/textarea><br
Address: <textarea name="[-- PRODUCT.Recordnumber --]:freeopt"
/textarea><br
City: Name: <textarea name="[-- PRODUCT.Recordnumber --]:freeopt"
/textarea><br
State: Name: <textarea name="[-- PRODUCT.Recordnumber --]:freeopt"
/textarea><br
Zip: Name: <textarea name="[-- PRODUCT.Recordnumber --]:freeopt"
/textarea><br

[-- END_IF --]

input type=image src="[--
OUTPUT_DIRECTORY_URL --]/media/button_add.gif" border=0 name="Add to Cart"
alt="Add to Cart"
/form
---------------------------
Note all the Text area lines. When this is displayed on the page there
will be a separate input field for each. When they are added to the
shopping cart they will all be put in the single field for the product
with a comma between each entry . You would need to sort out what the
shopper entered based on the commas. So it would look like this:
My Name, 283 N. Main, Any town, AnyState, 12345

You could include a separator between fields by putting something like
this between each of the textarea lines
input type=hidden name="[-- PRODUCT.Recordnumber --]:freeopt"
value=";"

But that would display as
My Name,;, 283 N. Main,;, Any town,;, AnyState,;, 12345
In the shopping cart and the shopper might wonder what all of the ,;,
characters in the text were.

I have seen a store where they have a button that pops open a dialog with
different input fields from the shopping cart screen . The shopper fills
in their information on that screen and it is passed back to the form
field for the product in the cart. I'm sure this requires javascript but
I don't know how it was done.

Note that the textarea could be any type of input so you could have a
single line input by using
input type=text name="[-- PRODUCT.Recordnumber --]:freeopt" size=50

Jim




Pam Laing wrote:
Does anyone know how to have multiple input text fields for products and
get them into the one text field allowed? I am not a javascript writer
and have been told it can be done, but don't know where to start.

The site is www.smallfrypress.net -- I have customized the page and
product templates which went fine. Just need the multiple input fields.

Thanks for any help anyone can provide!

Pam

Jim
 


Return to User Forum

Who is online

Users browsing this forum: No registered users and 135 guests