Categories > TinyButStrong general >

Selected item by default

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Leandro Ardissone
Date: 2006-02-28
Time: 18:38

Selected item by default

Hi,

How I can define the selected item by default if the variable used for selecting is empty?

I mean, with:
<option>[var._POST.shipping_country;selected]</option>

I set the default element of the list to the value of $_POST["shipping_country"]

But if $_POST["shipping_country"] i want that the element selected were United States, is this possible with TBS or I need to predefine the variables before?

Thanks
By: Skrol29
Date: 2006-02-28
Time: 18:44

Re: Selected item by default

Hi,

You can do it like that :
<option>[var._POST.shipping_country;selected;noerr;ifempty='USA']</option>
By: Leandro Ardissone
Date: 2006-02-28
Time: 18:47

Re: Selected item by default

great!

thanks so much! I *heart* TBS! :)