Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Noob Javascript question

Name: Anonymous 2009-04-30 21:25

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);
}

<input type="text" size="30" value="" id="inputIdHere" onkeyup="lookup(this.value, 'query.php');" onblur="fill();" />

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: Anonymous 2009-04-30 22:09

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

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List