how to use javascript function in this div

JavaScript and client side scripting.

Moderator: General Moderators

how to use javascript function in this div

Postby khalidhabib.cs » Tue Jul 17, 2012 10:29 am

Dear Friends I want get Value of following dv plz help
$(function(){
setAutoComplete("searchField", "results", "auto_complete_response_file/autocomplete.php?part=");
});


function setAutoComplete(field_id, results_id, get_url)
{

// initialize vars
acSearchId = "#" + field_id;
acResultsId = "#" + results_id;
acURL = get_url;
// create the results div
$("#auto").append('<div id="' + results_id + '"></div>');

// register mostly used vars
acSearchField = $(acSearchId);
acResultsDiv = $(acResultsId);

// reposition div
repositionResultsDiv();

// on blur listener
acSearchField.blur(function(){ setTimeout("clearAutoComplete()", 200) });

// on key up listener
acSearchField.keyup(function (e) {

// get keyCode (window.event is for IE)
var keyCode = e.keyCode || window.event.keyCode;
var lastVal = acSearchField.val();

// check an treat up and down arrows
if(updownArrow(keyCode)){
return;
}

// check for an ENTER or ESC
if(keyCode == 13 || keyCode == 27){
clearAutoComplete();
return;
}

// if is text, call with delay
setTimeout(function () {autoComplete(lastVal)}, acDelay);
});
}
khalidhabib.cs
Forum Newbie
 
Posts: 14
Joined: Tue Jul 17, 2012 1:35 am

Return to Javascript

Who is online

Users browsing this forum: No registered users and 7 guests