You are viewing the PKP Support Forum | PKP Home Wiki

utilize html_select_date

OJS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
The Public Knowledge Project Support Forum is moving to http://forum.pkp.sfu.ca

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.

utilize html_select_date

Postby jjgitties » Mon Jul 21, 2014 9:54 am

Hi, I am trying to make use of the html_select_date custom function in a form for a tpl page.

Is there a correct way to get output from function. Everything I have tried, it does not return any values.

My code is below:

tpl file
Code: Select all
<form method="post" name="search" id="search" action="{url page="page" op="search"}">
    {html_select_date prefix="start" all_extra="class=\"selectMenu\"" start_year="$yearOffsetPast" end_year="$yearOffsetFuture" time="$start"}
        <input type="submit" name="start" value="{translate key="common.search"}" class="button defaultButton" />

In the handler
Code: Select all
$start = Request::getUserVar('start') ? Request::getUserVar('start') : "null";
print $start . "<br>";

I tried start and search and no output.
Posts: 20
Joined: Tue Nov 12, 2013 11:11 am

Re: utilize html_select_date

Postby asmecher » Mon Jul 21, 2014 10:00 am

Hi jjgitties,

Use Request::getUserDateVar instead of Request::getUserVar.

Alec Smecher
Public Knowledge Project Team
Posts: 10015
Joined: Wed Aug 10, 2005 12:56 pm

Re: utilize html_select_date

Postby jjgitties » Mon Jul 21, 2014 11:54 am

I will try that right now.
Posts: 20
Joined: Tue Nov 12, 2013 11:11 am

Return to OJS Development

Who is online

Users browsing this forum: No registered users and 1 guest