Hi
I'm using the autocomplete to suggest keywords for a search.
I have the standard autocomplete working great so far.
What I'm trying to do is use the autocomplete for each keyword entered
into the search field. Each keyword is separated by a comma, i have
the php working by splitting the $_POST data into array and only using
the last array item. This works well however autocomplete replaces the
current field with the selected value i would like it to append to the
value to the field.
So how would i go about keeping autocomplete functionality but only
appending the selected value to the form input field?
My code so far:
new Ajax.Autocompleter('service', 'autocompletemenu', ''services/
autoComplete', {
updateElement: newUpdateElement
});
}
newUpdateElement = function(li){
//get form value so far
$previous = Form.Element.getValue("service");
Form.Element.clear("service");
// add the selected value to the html form
Form.Element.setValue("service", $previous+",
"+li.innerHTML);
}
This code works but appends after the letters you have lasted inputted
not replacing them.
Any help would be appreciated
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Prototype & script.aculo.us" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---