jQuery Autocomplete - Passing Extra Parameters |
[eluser]Kyle Johnson[/eluser]
Ran into an interesting problem. I downloaded and slightly modified the autocompleter library to allow for POST data instead of GET data. I didn't change anything else about the library. *Edit* I also disabled caching by commenting out a few lines. So I am trying to have a autocomplete input box send off for its data, but I wanted to pass some optional extra parameters to it. The autocompleter library allows for this, but for some reason my 'serial' argument is being ignored, well it is passing an empty string to the POST data. (I downloaded Firebug 1.3 for Firefox so that I can verify the POST data). Code: $(document).ready(function(){ *** Slight update *** I found out that the $("#serial").val(); only passes the initial value set to the form element with id="serial". Why is it not returning the most current value? Is it related to the function being withing the $(document).ready() event? *** End update *** The unmodified version can be found here. modified code here Code: function requestData(q) { second modified function Code: this.findValue = function(){
[eluser]Kyle Johnson[/eluser]
I upgraded from the previous version to this version found at: http://bassistance.de/jquery-plugins/jqu...ocomplete/ It seems to be much more confusing (in terms of coding) but I've figured out part of it at least. Code: $("#model").autocomplete( I think that would have worked on the older version as well, but there are other subtle improvements in the current library. |
Welcome Guest, Not a member yet? Register Sign In |