Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

[FIXED] Using selectors with JDom....input.calendar 13 Nov 2012 05:59 #5309

  • theitd
  • theitd's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 2
  • Thank you received: 1
Hi there,

I'm trying to replicate the advice given in the following thread:
www.j-cook.pro/forum/9-coding-inside-you...r-datefrom-is-filled

...and update another calendar field with the picked-date+1yr. If I alter the JDom type from calendar to text, it works.

My code is here:
<?php echo JDom::_('html.form.input.calendar', array(
                                                                                                'selectors' => array(
                                                                                                'onChange' => htmlspecialchars("updatedate();"),
                                                                                                'rel' => 'foo'),
                                                                                                dataKey' => 'assigned_on',
                                                                                                'dataObject' => $this->numbersitem,
                                                                                                'dateFormat' => "%Y-%m-%d",
                                                                                                'domClass' => "validate[custom[timeYYYYmmdd]]",
                                                                                                'validatorHandler' => "timeYYYYmmdd"
                                                                                                ));
?>

It results in the following html (with no onchange):
<input type="text" title="Monday, 21 March 2011" name="assigned_on" id="assigned_on" value="2011-03-21" class="inputbox validate-timeYYYYmmdd validate[custom[timeYYYYmmdd]]">

Is there a way of using the selectors with the JDom input type for the calendar?

Please Log in or Create an account to join the conversation.

Re: Using selectors with JDom....input.calendar 13 Nov 2012 16:14 #5338

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
Hi @theitd

Double check the source of the form because the calendar is just a widget. Even when you use the calendar, you are actually storing the value into a text field using a date mask according to your specifications.

In fact, if you want to make it 1 year after, it's probably best not to give the user access to change the second date. Anyway, however you choose to do it, you should check out this over at jquery:
forum.jquery.com/topic/jquery-date-problem

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The following user(s) said Thank You: admin

Please Log in or Create an account to join the conversation.

Re: Using selectors with JDom....input.calendar 13 Nov 2012 18:04 #5340

  • theitd
  • theitd's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 2
  • Thank you received: 1
Thank you, perfect!

I've added the <%SELECTORS%> tag to the calendar input form in:
<component_name>/dom/html/form/input/calendar.php

So the variable $html is now defined (from line 143) as....
$html = self::calendar(
                                       $formatedDate,
                                       $this->getInputName(),
                                       $this->getInputId(),
                                       $this->dateFormat,
                                       'class="' . $this->getDomClass() . '"<%STYLE%><%SELECTORS%>',

The link to the datepicker+1 is precisely what I'm trying to do too.
As a PHP and jQuery noob, j-cook has proved really useful - so thanks very much for the help.
The following user(s) said Thank You: JoomGuy

Please Log in or Create an account to join the conversation.

Last edit: by theitd. Reason: Removed attempt to highlight within CODE.

Re: Using selectors with JDom....input.calendar 21 Nov 2012 15:33 #5571

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Excellent.

Thanks.

Will check it out.
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

Re: Using selectors with JDom....input.calendar 21 Nov 2012 15:36 #5573

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Karma K+1

And Welcome to the community !
Excellent behaviors is to post solutions even before to ask for help.

Cool. :)
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

Last edit: by admin.

Re: Using selectors with JDom....input.calendar 28 Nov 2012 13:16 #5670

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
Fixed in JDom.

Thanks again.
Coding is now a piece of cake
The following user(s) said Thank You: JoomGuy

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.074 seconds

Just wanted to congratulate you on the J-Cook website / web development tool. In a couple of visits I've had a play around with Cook and have to say I think it is fantastic.  I've played with a number of component builders in the past and yours is certainly looking like the best so far. I'd also like to help you spread the word - I'm really surprised more people aren't excited about this tool. Good luck with the project.
Dean

Get Started