Joomla 3.4 custom calendar field with JQuery

General questions relating to Joomla! 3.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Locked
listerl
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Sat Jun 25, 2016 3:48 am

Joomla 3.4 custom calendar field with JQuery

Post by listerl » Sat Jun 25, 2016 4:04 am

Currently I am using the Calendar standard field of Joomla 3.4. However, I do not like it. I searched for a suitable calendar/datepicker and found this to be useful. Baffling as it may be, I couldn't find anything on Google that can help me understand how to implement it in Joomla.

I want to be able to define the attributes as follows:

Code: Select all

<field
        name="myfield"
        type="mycustomtype"
        description="description"
        label="label"
        required="true"
        (maybe more ...)
/>
Everytime the form loads, it will load the form element correctly, along with the js and css. In a form I may be using multiple fields with the same type, so I need to its id called correctly based on "name".

Does JHTML::register() have to do with it? I still cannot understand what this is used for, and where to use it to call for the function.

ws_machine
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 100
Joined: Sun Jun 14, 2009 12:43 am
Contact:

Re: Joomla 3.4 custom calendar field with JQuery

Post by ws_machine » Mon Jun 27, 2016 11:39 pm

Did you create a mycustomtype form field type? This file goes in your model/fields folder. Inside that file you would add the codes to display the popup calendar.
http://westernstudios.net - Joomla Tutorials, components, services
http://westernstudios.net/product/ws-jo ... bscription - Joomla Subscription Component

listerl
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Sat Jun 25, 2016 3:48 am

Re: Joomla 3.4 custom calendar field with JQuery

Post by listerl » Fri Jul 01, 2016 9:39 am

Yes. I've been planning to do that. And I've explored into the calendar codes and able to add the jquery datepicker just like I wanted. However, I'm unable to pick any date. The calendar shows (but transparent) when the text is focused, and when I click on a date, the calendar disappears and no date is in the text. The funny thing is that, when there is some elements behind the calendar, eg: buttons, text fields, I can't click on the date, but if there is no element behind, I can click it and the date is shown the textbox. It shows the same result when I tried to implement directly on the page, not using the custom field. Any idea why, and how to fix it?

listerl
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Sat Jun 25, 2016 3:48 am

Re: Joomla 3.4 custom calendar field with JQuery

Post by listerl » Fri Jul 01, 2016 11:22 am

Found that it works with different templates. The template that I used is using bootstrap 3. Would that be the cause of the issue?

listerl
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Sat Jun 25, 2016 3:48 am

Re: Joomla 3.4 custom calendar field with JQuery

Post by listerl » Fri Jul 29, 2016 8:55 am

No it is not the bootstrap. The solution is found in http://stackoverflow.com/questions/7033 ... ndex-issue, that is to add style=" position: relative; z-index: 100000;" at the 'input' text element.


Locked

Return to “General Questions/New to Joomla! 3.x”