|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
rustybucket Smarty Regular
Joined: 28 Jan 2009 Posts: 60
|
Posted: Tue Jul 14, 2009 12:04 pm Post subject: html_select_date Pre-Selecting a year. |
|
|
I have an 'add product' form with a selection for 'modelYear'. I want to be able to pre-populate this form should a user be editing a product.
This is what I have, shows the years fine and works great.
{html_select_date prefix='model' start_year='+1' end_year='-100' display_days=false display_months=false reverse_years=true}
This is what I would like to have, but doesn't work.
If a product is being edited, use the var, else use +1
{html_select_date prefix='model' start_year='{if $inv}$inv.modelYear{else}+1{/if}' end_year='-100' display_days=false display_months=false reverse_years=true}
Any ideas or guidance of how to accomplish this?
Thanks,
rusty |
|
Back to top |
|
rustybucket Smarty Regular
Joined: 28 Jan 2009 Posts: 60
|
Posted: Tue Jul 14, 2009 2:42 pm Post subject: |
|
|
It looks like I was looking at the wrong parameters. Looks like the selected= tag works
{html_select_date prefix='model' start_year='+1' end_year='-100' display_days=false display_months=false reverse_years=true selected=$inv.modelYear} |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|