ElJayWilson
Programmer
I just cannot get this to work. I am trying to use an Autocomplete with a windowing system and it just won't work. Here is the code I use to create a window:
I have tried several autocomplete methods, with the best one I saw being here (
I know this must be a DOM issue, but I just cannot get the autocomplete box to work. When I use the windowing system, I have access to the elements on the form (textbox values, etc).
I can send more code if needed. BTW I am using a PHP script to generate the original page. I am also using the following code to capture keypress events:
The autocomplete script also uses the onkeydown event to do stuff, so maybe that could be causing issues. If there is a better way, let me know. My whole goal is to have an autocomplete system for the user to type in a name. I populate an array of all customers when the main javascript page loads.
Thanks,
LJ
Code:
function createwindow(parameters)
{
dialogopen=true;
var divid = parameters['divid'];
var title = parameters['title'];
var text = parameters['text'];
var width = "width=" + parameters['width'] + "px";
var height = "height=" + parameters['height'] + "px";
var resize = "resize=" + parameters['resize'];
var scrolling = "scrolling=" + parameters['scrolling'];
var center = "center=" + parameters['center'];
var settings = "'" + width + "," + height + "," + resize + "," + scrolling + "," + center + "'";
var firstinput = parameters['firstinput'];
var myhtml = "";
var wintype = "inline"; //parameters['wintype'];
var winloc = parameters['winloc'];
myhtml+= ' <form action="" onsubmit="return false;" name="dialogform" id="dialogform" class="dialog">';
myhtml+= ' <table id="dialogtable" cellspacing="0">';
myhtml+= parameters['html'];
myhtml+= '</table>';
myhtml+= '</form>';
dialog=dhtmlwindow.open("mywin", wintype, myhtml, title, settings);
//dialog=dhtmlwindow.open("mywin", wintype, winloc, title, settings);
//var myobj = actb(document.getElementById('tb'),collection);
dialog.onclose=
function () {
dialog.hide;
dialogopen=false;
clearinput();
return true;
}
if (wintype=="inline")
{
if (firstinput)
{
var element = document.getElementById(firstinput);
// Use a delay so that IE will give focus properly
setTimeout('document.getElementById("'+firstinput+'").select()', 100)
document.getElementById(firstinput).value="";
document.getElementById(firstinput).focus();
}
}
}
I have tried several autocomplete methods, with the best one I saw being here (
I know this must be a DOM issue, but I just cannot get the autocomplete box to work. When I use the windowing system, I have access to the elements on the form (textbox values, etc).
I can send more code if needed. BTW I am using a PHP script to generate the original page. I am also using the following code to capture keypress events:
Code:
document.onkeydown = getkeycode;
The autocomplete script also uses the onkeydown event to do stuff, so maybe that could be causing issues. If there is a better way, let me know. My whole goal is to have an autocomplete system for the user to type in a name. I populate an array of all customers when the main javascript page loads.
Thanks,
LJ