I got a form with both Swfupload and Datepicker (from the Event module: sites/all/modules/contributed/event/contrib/datepicker/jquery.datePicker.js).
When the Datepicker's there without Swfupload, it works just fine. If Swfupload's there without Datepicker (like in other content types), it works just fine as well.
When the two are together on the same form, the whole thing goes weird. The datepicker shows a link "Select date". When you click on it, the datepicker appears. With Swfupload on the form, the moment the page finishes loading, that link gets added again (so you got: "Select dateSelect date"). Each time you click the mouse -- no matter where on the page -- it gets added again. After one click, it shows: "Select dateSelect dateSelect date".
Both the datepicker itself works (but only on the original link) and Swfupload work, so it's a purely aesthetical issue. It's still an issue, though, but can't find a way to fix it. Any help would be appreciated.
Comments
Comment #1
Raf commentedOk, got a workaround, in case anybody is stuck on the same issue (highly doubtful, cause it's a very specific usecase, but you never know).
I pretty much put the two naughty boys separately. I first installed the Multistep module, then configured the content type that uses both to use Multistep, and separated both. It did require a bit of changes using hook_form_alter to put the datepicking part in a fieldgroup, and overwriting the validate function the Event module adds (using hook_form_alter as well) to handle this change properly. Now, it all works just fine. Of course, it's not a solution if you just have two fields. Using a multistep form'd be a bit stupid then.
Comment #2
guatebus commentedHi Raf,
Could I ask you for some code (or pseudo code) as to how you managed to get Swfupload on your form? I'm trying to do this but I'm having lots of trouble.
Thanks!
gb
Comment #3
Raf commentedI got code from that project, but it's been a year and a half, so can't promise that the solution's still in it. Things have evolved big time since. But let's see...
And the validation callback:
I don't remember what it all does (really should have commented my code back then...). There's also been too much going on in that form over time. It could also be that I left some stuff in that isn't necessarily related to this specific issue.
So yeah, I'm afraid I can't be of much help, but I hope this can help you solve the problem nonetheless.