Page 1 of 1

[SOLVED] How do I retrieve the selection from {html_select_date}

Posted: Sun Feb 01, 2009 5:41 pm
by dazu
I'ts driving me crazy:

I have a template with the date selection :


   {$field_descr_date}:
    {html_select_date time=$startdate start_year="-0" end_year="+2" prefix="startdate_"}


So far so good, the date is displayed nicely in my form. However when I process the entries I receive all fields but NOT the date. I simply do not know how the selected date (Day, Month and Year) are passed back. All other fields I find in the params['xxx'], but not the Date  :(
I tired all sorts of variables ($startdate, $startdate_Year etc.)
Can sombody please point me in the right dierection ?

Thanks
Daniel

Re: How do I retrieve the selection from {html_select_date}

Posted: Wed Feb 04, 2009 12:53 pm
by dazu
Surely someone must know?  :(

Re: How do I retrieve the selection from {html_select_date}

Posted: Sat Feb 07, 2009 10:38 pm
by Duketown
dazu,

Have you checked in the News module action.editarticle.php it contains:

Code: Select all

$postdate = time();
if (isset($params['postdate_Month']))
  {
	$postdate = mktime($params['postdate_Hour'], $params['postdate_Minute'], $params['postdate_Second'], $params['postdate_Month'], $params['postdate_Day'], $params['postdate_Year']);
  }
Hope this helps,

Duketown

Re: How do I retrieve the selection from {html_select_date}

Posted: Mon Feb 09, 2009 7:36 pm
by dazu
Hi Duketown
Thanks. yes I did look at the news module. And I dumped all the params['xxx'] values to see what I get returned. But there are no values for the date (all other fields are there). In the html source the forrm and its fields are correct. If I know that I need to follow up on the params['date_Month'] etc. I hope I can narrow it down. So far I was not sure how I should get the values returned to my module.

I keep looking as soon as I have time again... lost a bit of momentum :-(

Thanks
Daniel

Re: How do I retrieve the selection from {html_select_date}

Posted: Mon Feb 09, 2009 9:46 pm
by Duketown
dazu,

According to me, due to the usage of {html_select_date}, automatically _Month, _Day etc are connected as postfix to the prefix as defined by yourself.
So in my example (sorry the example from News) change postdate_ into startdate_ and things should be working.

Duketown

[SOLVED] How do I retrieve the selection from {html_select_date}

Posted: Sun Feb 15, 2009 10:11 am
by dazu
Its working now. Thanks for all the help. The problem was the following:
I forgot to add the

Code: Select all

$this->smarty->assign('startdateprefix', $id.'startdate_');
in the action.add_adit.php

Not sure why this is required.. I quess I need to study the smarty documentation  :-[