This topic is locked

MM/YYYY field instead of dd/mm/yyyy

12/6/2011 8:52:30 AM
PHPRunner General questions
C
chingupt author

Instead of the standard dd/mm/yyyy field, i want to display a field which caters to month and year only i.e. MM/YYYY only.
How can i achieve this in phprunner?
Regards

Sachin

C
cgphp 12/6/2011

Set the field as Custom (http://xlinesoft.com/phprunner/docs/_view_as__settings_custom.htm) and enter this code:

$value = date("m/Y",strtotime($value));
T
Tayyab Ilyas 12/6/2011

how to change date format on add/edit page, i want month and year only in dropdown box.

C
cgphp 12/6/2011

In the "Javascript onload" event of add/edit page, enter this code:

var select_day = $("select[id^='dayvalue_']");

select_day.val('1');

select_day.hide();
C
chingupt author 12/7/2011

Hi Cristian,
Am sorry, didnt get you.

On the add/Edit page, there are 3 date fields, date1, date2, date3.

Req is that only for date1 field, want month and year only in dropdown box, for the others date2 and 3, the dd/mm/yyyy format should be followed.
Also is the solution provided in the last post the correct one or the first one?
<--

In the "Javascript onload" event of add/edit page, enter this code:
var selectday = $("select[id^='dayvalue']");

select_day.val('1');

select_day.hide();

-->
Regards

Sachin

C
cgphp 12/7/2011
var select_day = $("select[id^='dayvalue_???']");

select_day.val('1');

select_day.hide();



Replace ??? with the actual date1 field name. Paste the code in the "Javascript onload" event.

C
chingupt author 12/13/2011

Hi,
The day value is changing, but the field still shows.

Unable to hide the day field.
Please help.
Regards

Sachin

C
chingupt author 12/13/2011

Hi Sergey,
Your inputs on this also please.
Regards

Sachin.

S
stiven 12/14/2011

view the source of the page and find out what is the id for the day drop down of the field date you want to hide and add this code on the Javascript onLoad page events



document.getElementById('dayvalue_date_1').style.display = 'none'; // replace the dayvalue_date_1 for the id you found out on the source of the page
C
chingupt author 12/15/2011

Hi
Its not working.
Regards

Sachin

S
stiven 12/15/2011

if you post an url and the code we can help you better



Hi
Its not working.
Regards

Sachin