Hello,
I have the following problem with AHAH:
Is it possible that this module doesn't work with the #autocomplete_path -option from Forms API?
How do I make it work together? Any pointer would be helpful - it is just a little thing after all.
Greetings.
Comments
Comment #1
nhck commentedI found a pretty bad solution:
upon creating your subform, add this to each element
however: you don't get all the beauty of it, for example once you press Enter the thing gets submitted.
Comment #2
macm commentedMy solution:
Works fine!
Comment #3
macm commentedMy solution:
Works fine!
Comment #4
nhck commentedso you are saying you didn't need a hack, but I need one? strange...
Comment #5
nhck commentedokay, uhm - I just downloaded a fresh copy of drupal, and a fresh copy of aha and this doesn't work. I tried to insert this line:
'#autocomplete_path' => 'users/autocomplete',as I tried before and as you mentioned. However upon pressing the cursor-button "down" and then pressing "Enter" The form gets submitted.So if your Username is "Bob" and you insert "B" the dropdown is present to you - and even though you selected Bob from the List and hit enter - only a "B" will be submitted.
Moreover after the form is submited the newly created input field for the todo-list doesn't provide the autocomplete-capabilities anymore.
Comment #6
beltofteI had the same problems as you have Niels. I added
'#attributes' => array('onClick' => "Drupal.autocompleteAutoAttach();")to all my fields where i need autocomplete. It fixes the problem with the autocomplete that does not work after the form is submittet.But i stil have the problem with "enter" in the autocomplete field. I was thinking about some javascript to fix the problem, but have not looked into it yet.
Comment #7
fall_0ut commentedThe only solution for this, seems to be by including the function
Drupal.autocompleteAutoAttach();at the functionAhah.attach_all_bindings.Now, ideally Ahah should provide a javascript hook, so we could dynamically include more javascript that should be run "after" Ahah submitted and fetched new data from the server.
Comment #8
nhck commented