Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Can't prevent date selection in {html_select_date}

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
Rudloff
Smarty n00b


Joined: 06 May 2015
Posts: 2

PostPosted: Wed May 06, 2015 10:18 am    Post subject: Can't prevent date selection in {html_select_date} Reply with quote

Hello,

The doc for {html_select_date} says that we can prevent date selection by passing NULL but it does not seem to work.
I do pass NULL:
Code:

$smarty->assign(
    array(
        'dateOfBirth'=>null
    )
);

but it still selects the current date.

Regards,
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Wed May 06, 2015 9:39 pm    Post subject: Reply with quote

you did not show your template code.
But the time attribute must be null like
Code:
{html_select_date time=null... }

It does work.
Back to top
View user's profile Send private message
Rudloff
Smarty n00b


Joined: 06 May 2015
Posts: 2

PostPosted: Thu May 07, 2015 7:44 am    Post subject: Reply with quote

I found the problem.

I was doing
Code:
{html_select_date time="$dateOfBirth" all_empty=""}

instead of
Code:
{html_select_date time=$dateOfBirth all_empty=""}


I guess that's because is requires null and not an empty string.
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Thu May 07, 2015 4:58 pm    Post subject: Reply with quote

Yes, you are right. If you pass a variable as attribute you should never use quotes.
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
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
Protected by Anti-Spam ACP