So I have this script I found for autocomplete forms that runs off of a sql query on keyup. The problem I'm facing is sending the clicked item to the field you type in
function fill(thisValue) {
$('#inputIdHere').val(thisValue);
setTimeout("$('#suggestions').hide();", 200);
}
mind you this isn't all of it but should be the section causing the problem. I want to either find the id currently 'inputIdHere' or I want to type it as a variable in fill();
but when I type it in fill i break thisValue as far as i can tell
halp?
Name:
Anonymous2009-04-30 21:29
cont.
i break it when if i do something like
>function fill(idname, thisValue){ etc.}
>onblur="fill('inputIdHere');"
its thisFailue fucking me up..
And here is my interpretation of what you actually want to do but failed to explain. Which sends a query, stores the result in sqlResult- and then writes that result to the input box onblur.
>>10
I've already shown you, don't fucking use onblur, onkeyup etc bullshit, jquery has its own for a reason. I'm presume you want the same behavior for multiple inputs which is why you need to be able to see which input to modify. Use something like $("input.customClassName").blur(function() {
$(this).val("PENIXEN");
});
Then you can just give each input you want to have this onblur effect the class "customClassName".
>>9
The faster I help him the faster he will fuck off.