|
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 |
sccr410 Smarty Rookie
Joined: 29 Jun 2005 Posts: 10
|
Posted: Thu Dec 15, 2005 12:17 am Post subject: html_select_date - nothing preselected |
|
|
I don't want to have the current time preselected. I can't find a way to make this happen. It always preselects the current time no matter what I have tried.
I am creating an events calendar and each event has a start date/time and an end date/time. However, an end date/time is not required. However, with the current way html_select_date works, you cannot allow for an empty value to leave blank. |
|
Back to top |
|
TGKnIght Smarty Junkie
Joined: 07 Sep 2005 Posts: 580 Location: Philadelphia, PA
|
Posted: Fri Dec 16, 2005 2:54 pm Post subject: |
|
|
Try something like this :
Code: |
{html_select_date prefix="do_DepartureDate" end_year="+5" field_separator="/" time=$do_DepartureDate|default:"-00-00" all_empty="--"}
|
This should default the field to --/--/---- |
|
Back to top |
|
sccr410 Smarty Rookie
Joined: 29 Jun 2005 Posts: 10
|
Posted: Fri Dec 16, 2005 5:35 pm Post subject: |
|
|
Thanks, worked perfect.
Is there a method to do this with html_select_time as well? I tried the same thing and it caused errors. I guess html_select_time isn't written the same way. |
|
Back to top |
|
sccr410 Smarty Rookie
Joined: 29 Jun 2005 Posts: 10
|
Posted: Fri Dec 16, 2005 6:05 pm Post subject: |
|
|
Nevermind, I altered the html_select_time function to allow for all_empty just like html_select_date |
|
Back to top |
|
TGKnIght Smarty Junkie
Joined: 07 Sep 2005 Posts: 580 Location: Philadelphia, PA
|
Posted: Fri Dec 16, 2005 6:48 pm Post subject: |
|
|
After some fooling around it appears that you are correct, there is not a way to have a blank time field...
Here is an idea though... leave the {html_select_time} as is with whatever time is in there...
When you are performing your database operation, check the field for date, and if it = 00-00-0000 then do not insert a time, or alter the time insert to be all 0's as well. |
|
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
|