Forums

Can datepicker display permanently in form?

decaf 05 Sep, 2012
Hi All

I'm creating a reservation form and would like the datepicker calendar to display permanently and not only when the the datetime box is selected. Is this possible?

joomla 2.5.6
chronofoms v4

Thanks in advance for any help.
Max_admin 06 Sep, 2012
Not sure if this will work, but try this code in a load JS action:


window.addEvent('domready', function() {
document.id("DP_FIELD_ID").fireEvent("focus");	//replace the field id of your datepicker								
});
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
decaf 06 Sep, 2012
Thanks for your response but I had no luck with the suggestion. I can see what you were trying to do though, focus on datepicker field forcing the calender to activate.

Any other suggestions? would love to get this to work.

Thanks again!
Max_admin 09 Sep, 2012
Well, the other solution will involve custom coding, try that code in a load JS action:

window.addEvent('domready', function() {
var dp = new DatePicker('inputField', { 
    timePicker: true, 
    pickerClass: 'datepicker_jqui'
});
dp.show();
});


Not tested though!

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
decaf 10 Sep, 2012
I got something. It seemed to have loaded the days of the week (MO-SU) and all the days of the current month but without any structure or styling around it. And when you click on any of the days it simply disappears.

I feel it might be a tricky one to get to work. Thanks for trying though. I'll see what else I can find.
GreyHead 10 Sep, 2012
Hi decaf,

Max's code sets the jqui format, that may be causing the formatting problems.

I suspect that this is going to be very tricky without hacking the datepicker core code. It just isn't built to work this way. You might be able to get round it by firing the show() method every time a date is picked so that the calendar is re-displayed.

I think though that I'd look at a PHP calendar if I needed one that was permanently displayed. There are a few around that you could include. I just Googled and found one here that is somewhat similar to the MooTools DatePicker. You'd set it up by using a Custom Code action to load the files and the set-up PHP.
!!Note - this isn't tested or recommended, just an example!!

Bob
decaf 11 Sep, 2012
Hi Bob

Many thanks for pointing me in the right direction. This is pretty much what i'm looking for. I'll be giving it a go with my limited programming knowledge and I hope to report back to you with a positive result.

I'll keep you posted on any progress.

Kind regards
Decaf
This topic is locked and no more replies can be posted.