Autocomplete fields in popup don't work
BWPanda - March 30, 2009 - 01:53
| Project: | Popups API (Ajax Dialogs) |
| Version: | 6.x-2.0-alpha5 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
I'm using your Popups: Add and Reference module to create a new node in a popup window. The node I'm creating has an autocomplete field as part of it (specifically, the Province field from the Location module) which doesn't seem to work (i.e. no options appear when I start typing in it)...
I'm guessing this is part of the whole certain-features-don't-work-properly-in-a-popup-window problem, but just wanting to know if /when this can be fixed...
Thanks!

#1
Weird..
It works when using the add + reference but not the regular popup links...
Also the collapsible regions follow the same trend..
What's the difference? How do you get em all to work?
#2
I'm also having the same problem but only with IE6 & IE7.
#3
Same in firefox (v.3, ubuntu)
#4
there's also a usability issue, can't say it's a bug.. I usually start typing a few letters until the autocomplete starts and gives me choices.. because my both hands are on the keyboard I usually move with the keyboard until I find the right option and then hit enter.. well, if I do this with popups the form it's submitted because of the enter... that's not right..
I don't know if anyone has this problem..
#5
The popup add & reference module has autocomplete and collapsible regions working perfectly. From what I've read, I believe it's because it includes the needed javascript files which seems like it can only be done from within the module. I'm going to look into it more and perhaps it can be replicated from nodes via php.
#6
alright alright i know i'm the best...
just add this before the link or however you want to implement it..
<?phpdrupal_add_js('misc/autocomplete.js');
drupal_add_js('misc/collapse.js');
?>
#7
Do you mean that this JS has to be loaded on the page the popup link is on, or the html inside the popup?
#8
Read the documentation on the module. Create a dummy module to hook the popups.
function helper_popups() {return array(
'*' => array(
'a[href^=/messages/new]' => array(
'additionalJavascript' => array(
'misc/textarea.js',
'misc/autocomplete.js',
),
),
),
);
}
#9
cool, thanks for the workaround!
Do we know why popups is't loading the js on it's own?
#10
it's not a work around..that's how you tell popups what to load...you can load additional css too...
#11
so privatemsg (in this case) should be loading it's own js / css with this hook to be correctly integrated, but we can make a custom module instead for modules that do not yet support popups?
#12
Not really but I understand your point...
#13
Slightly OT, but relevant nonetheless. The approach in #8 isn't documented in the current popups README.txt and I can't find any further reference to documentation on the project page. Can anyone point me to some proper popups docs? =)
#14
additionalJavascript and additionalCSS properties only work for 1.3... it has since been removed from the 2.0 branch, but there is additional code now so that popups should do this on it's own. I am only using 1.3 right now, so i don't know how well it's working. not sure if these 2 properties are documented in 1.3 or not.
#15
Hmm, strange. I'm using 6.x-2.0-alpha5 and it isn't loading my JavaScript, hence me looking in to the hook. Sounds like I need to raise a bug report, but I'll try and work out what's happening first.
#16
The same problem.
I'm using nodereference field.
#17
I'm not sure if this is exactly the same bug...depends on what is meant by "don't work".
In Firefox, the autocomplete fields in my popups technically do work, but they are covered up by the browser's own autofill pulldown.
e.g.
When I load my form on a normal page, the field has a white background and autocomplete works as expected. But, if I load the form in a popup, the field has a yellow background and typing in it brings up the browser's Form Autofill suggestions.
However, if I have a big enough autocomplete list, I can see it sticking out from behind the browser's autofill list, so I can see that it's actually working, but for some reason the browser won't disable it's own pulldown. I tried the drupal_add_js() suggestion but it makes no difference.
Sound familiar to anyone?