0

Can someone help please?

I'm working on a simple component which displays events. The component allows events to be submitted from the frontend. The form uses the Joomla datepicker.

The problem I'm experiencing is when I click on a date in the datepicker it doesn't populate/fill the field. The placeholder doesn't show either. Also, I can't manually type in the field.

I also have an equivalent form in the backend which also uses the datepicker and that works just fine.

One interesting thing I've discovered is, if I switch from my template to the 'protostar' template I still experience the problem, but if I switch to the 'Beez3' template the datepicker and field works perfectly.

What am I missing?

Many thanks.

enter image description here

13
  • 1
    What happens if on the same page you just echo out a calendar field using: <?php echo JHtml::calendar(); ?> ?
    – Zollie
    Jan 9, 2020 at 16:24
  • 1
    Of course because that method needs some arguments, but I thought that you might know this, so I give you a sample including some arguments for trying: <?php echo JHtml::calendar(“2019-12-24”, "field-calendar-150", "jform-field-150", '%Y-%m-%d'); ?>
    – Zollie
    Jan 9, 2020 at 18:58
  • 1
    Sorry @Zollie, I realised this after and added the arguments and it displayed perfectly. I did switch on development mode and no errors showing.
    – JJBW
    Jan 9, 2020 at 19:05
  • 1
    Applying your suggestion led me to compare it's output with the input field and doing this helped me find the issue. Believe it or not it was a CSS issue. The datepicker input field had a font size of 100% (All the other input fields didn't) which forced the content out of the field. Overflow was also hidden. Adjusting this sorted it! Thanks for all your help @Zollie, it's very much appreciated.
    – JJBW
    Jan 9, 2020 at 19:41
  • 1
    Please create a short but descriptive answer from what you found and you can accept that as a solution. That way the question will be closed with a useful answer and probably will help someone later.
    – Zollie
    Jan 9, 2020 at 19:59

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.