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
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

mikestefff - May 8, 2009 - 07:47

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

lelizondob - May 9, 2009 - 01:30

I'm also having the same problem but only with IE6 & IE7.

#3

mikestefff - May 9, 2009 - 01:37

Same in firefox (v.3, ubuntu)

#4

lelizondob - May 9, 2009 - 02:55

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

mikestefff - May 9, 2009 - 04:10

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

mikestefff - May 9, 2009 - 04:22

alright alright i know i'm the best...

just add this before the link or however you want to implement it..

<?php
drupal_add_js
('misc/autocomplete.js');
drupal_add_js('misc/collapse.js');
?>

#7

frankcarey - June 17, 2009 - 14:20

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

mikestefff - June 17, 2009 - 16:30

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

frankcarey - June 19, 2009 - 16:26

cool, thanks for the workaround!

Do we know why popups is't loading the js on it's own?

#10

mikestefff - June 19, 2009 - 17:10

it's not a work around..that's how you tell popups what to load...you can load additional css too...

#11

frankcarey - June 22, 2009 - 15:20

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

mikestefff - June 22, 2009 - 15:56

Not really but I understand your point...

#13

greg.harvey - July 17, 2009 - 10:20

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

frankcarey - July 20, 2009 - 18:37

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

greg.harvey - July 21, 2009 - 07:52

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

kenorb - August 12, 2009 - 14:15

The same problem.
I'm using nodereference field.

#17

partap - August 26, 2009 - 19:32

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?

 
 

Drupal is a registered trademark of Dries Buytaert.