X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Change Text field to drop down in Product_details.tpl? (https://forum.x-cart.com/showthread.php?t=38740)

PrairielandGolfCars 04-01-2008 09:32 AM

Change Text field to drop down in Product_details.tpl?
 
We have the Brand/Year/Model modification installed and would like to pre-populate a drop down for onf of the new fields it created, "type".

We currently have this in the code:
PHP Code:

{if $productids ne ''}<TD width="15" class="TableSubHead"><INPUT type="checkbox" value="Y" name="fields[type]"></TD>{/if}
  <
td class="FormButton" nowrap>{$lng.lbl_type}</td>
  <
td class="ProductDetails"
    <
input type="text" name="type" size="45" value="{ $product.type}"


How would we change it to a <SELECT statement?

It list doesn't have to be database driven, we only have three types, (Gas, Electric, Common)

I know how to do a regular HTML form <Select ... statement, but I'm not sure how/where to code the database name and field to insert the data selected?

Yurij 04-02-2008 12:33 AM

Re: Change Text field to drop down in Product_details.tpl?
 
PHP Code:

<select name="type">
        <
option value="Gas" {if $product.type eq "Gas"}selected{/if}>Gas</option>
        <
option value="Electric" {if $product.type eq "Electric"}selected{/if}>Electric</option>
        <
option value="Common" {if $product.type eq "Common"}selected{/if}>Common</option>
 </
select


PrairielandGolfCars 04-02-2008 05:06 AM

Re: Change Text field to drop down in Product_details.tpl?
 
Thank you!

I've bookmarked your site 8)


All times are GMT -8. The time now is 07:39 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.