Whenever I build a form and add more date-enabled fields to it using the AHAH api, reloading the section that contains all of the date popup fields, none of the date popup fields are date popup enabled (they are simply textfields).
Steps to create:
1. Create a form with a date popup field.
2. Setup AHAH to add another date popup field, with the method set to 'replace'
3. Click the AHAH button.
(This is very similar to #244025: JQuery Calendar quits working when you add a new field)
| Comment | File | Size | Author |
|---|---|---|---|
| #16 | filename.patch | 1.81 KB | bwynants |
Comments
Comment #1
marz71 commentedI have the same problem. When I add some ahah components and refresh wrapper using ahah, the date_popup calendar does not popup anymore.
Regards,
Marek
Comment #2
cvandyke commentedI have the exact same problem.
Comment #3
timtrinidad commented+1
Comment #4
vip_sa commentedThe date pop up on my site just do not work. I am using IE8 and Firefox 3.52. I have installed the jquery UI module but still I cannot get the date pop up to appear on any browser
Comment #5
niklp commentedI have installed the JQuery UI module and added the download as instructed - the instructions aren't great, and there's no warning as to whether that's happened or not, that I can make out anyway. That's more the problem of the JQuery UI module however.
Works in Flock 2.0, IE 7, but not Firefox 3.5
Comment #6
talino commentedSame here. I had to deactivate JQuery UI, which works in Safari & Opera but not in Firefox.
Comment #7
bwynants commentedSame problem here, I add an extra 'date_popup' type fields via a #ahah wrapper and the popup-calender no longer pops up on the 'date_popup' type fields. They did work before I clicked the #ahah button however
Comment #8
bwynants commenteddouble post
Comment #9
emptyvoid commentedSimilar discussion here: http://drupal.org/node/436490 (Add support for jQuery update to 1.3.x and jQuery UI 1.7.x)
I posted a css update
Comment #10
m.crane commentedThis is definitely not a duplicate - that problem is the date popup looking bad when you update jQuery. This problem is that, when using AHAH, the date popup functionality of fields is lost (they worked properly before additional fields are added) when more fields are added (which should have date popup functionality).
Comment #11
bwynants commentedvery true!
Comment #12
wanghl165 commentedsame here
Comment #13
wanghl165 commenteddate popup module sets the date field ids and settings in the Drupal.settings.datePopup, then Drupal.behaviors.date_popup looks for ids only existing in it and bind event for them. but after adding more date fields by ahah, the new ids of the new date field are not in the Drupal.settings.datePopup, that is why date popup doesn't work with ahah.
So I create a js file to find all the date fields by its' name like 'input[name*="[date_begin][date]"]' and 'input[name*="[date_begin][time]"]' but not its' id and make the first item in the Drupal.settings.datePopup as the arguments of the bind event, then, rebind event like date_popup.js.
Finally, it works with ahah.
Comment #14
bwynants commenteddo you have a patch available?
Comment #15
wanghl165 commentedThis is not patch, it is just a way to make date popup work with ahah
AHAH wrapper:
js code:
Comment #16
bwynants commentedbased on your solution I made this patch.
Not sure why your date fields have a -begin in the ID's however
Anyway apart from the lookup $('input[name*="[date][date]"]') I have no hard coded strings in this patch....
Comment #17
mafioso commentedalready tried the patch but didn't work for me.
Comment #18
bwynants commentedwhat is the id of your input fields in the html?
eg: id="edit-selects-0-date-dateEntry-popup-1"
Comment #19
mafioso commentedbwynants,
The #15 workaround works for me, like wanghl165 on #13 wrote:
so, i did replace [date_begin][date] with the value of the name attribute only, not the ID.
Comment #20
bwynants commentedas I said my input fields are named [date][date] yours seem to be called [date_begin]
in the first line of the patch I look for [date][date], change that to [date_begin][date]
+ $('input[name*="[date][date]"]').each(
a proper solution must be found by the module maintainer I guess
Comment #21
sukr_s commenteda simpler solution is to return the necessary js functions in your ahah handler
This works fine with the pop ups, but I faced the problem with submit. $form_state['values']['my_date_field'] did not have the value that was entered. So I used the $_POST['my_date_field'] value and this works fine...
Comment #22
karens commentedThis is not a bug report, it is a support request about how to add custom AHAH handlers to an already very complex field.
I can't help you much here, getting this stuff working in the first place was very challenging. If you want to do things like add your own AHAH handlers to the mix you're pretty much on your own.
It sounds like there are ideas in the issue that you can use.
If someone wants to add some documentation to the handbook about how to get this stuff working it would be great, but I'm really not able to support every kind of custom adaptation of the code anyone might come up with. My focus in this issue queue is making sure that the out of the box code works.
Comment #23
bwynants commentedyou did fix it in #560054: Create and remove multiple repeat exceptions (without needing to save node for every exception) ! see date_repeat_form.inc
Comment #25
marthinal commentedTheres another easy way .i change the id with jQuery and then i execute Drupal.attachBehaviors($('#edit-date-start-datepicker-popup-0')); to the id ....here you have working the date popup also.
Comment #26
FranciscoLuz commentedHi folks,
Make use of ahah_helper module (Dev version at 25 Feb 2011 or later) and apply this patch here http://drupal.org/node/797742#comment-3036010.
This, among other things, will fix the data popup issue.