bazz
05-03-2009, 04:23 AM
Hi,
I am an absolute beginner with AJAX and I have very little understanding of JS. Yet I need to achieve the following. If someone is willing to write it for me I can repost in the work offers requests forum ;)
I have a series of text boxes in my perl driven dynamic page. I need to ensure that when a user starts to enter a value in the first box that any potential matches with data already in the specific db column, show up at the entry of the fourth character in whichever box.
Then if they have chosen an existing value and they move to the second box, it automatically shows the possible matches before they type anything. And having made that entry in box 2, the possible list ofr box three shows when they click on that textbox.
I suppose it could be described as a multi combo box drop down, except it's with textboxes instead of 'selects'.
here's the form
<form action='/cgi-bin/script.pl' method='get'>
<input type='textbox' name='group_name' value ='' />
<input type='textbox' name='premises_name' value ='' />
<input type='textbox' name='business_name' value ='' />
<input type='hidden' name='action' value='submit' />
<input type='submit' value='Enter' />
</form>
And both in CF and in some tutorials, this is all I have managed to compile :(
I'm on a tight time schedule hence my mention of the work offers forum.
function create_ajax_request(){
this.xmlHttp;
try {
this.xmlHttp = new XMLHttpRequest();
}
catch (e) {
try {
this.xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
this.xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
alert("Your browser does not support AJAX!");
return false;
}
}
}
}
function send_ajax_request_post(){
this.xmlHttp.open("POST", this.ssurl, true);
this.xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
this.xmlHttp.setRequestHeader("Content-length", this.pdata.length);
this.xmlHttp.setRequestHeader("Connection", "close");
this.xmlHttp.send(this.pdata);
this.xmlHttp.onreadystatechange = function(){
if (this.xmlHttp.readyState == 4) {
if (this.xmlhttp.status == 5) {
this.request_done();
}
}
};
}
Any help you can offer will be gratefully appreciated.
bazz
I am an absolute beginner with AJAX and I have very little understanding of JS. Yet I need to achieve the following. If someone is willing to write it for me I can repost in the work offers requests forum ;)
I have a series of text boxes in my perl driven dynamic page. I need to ensure that when a user starts to enter a value in the first box that any potential matches with data already in the specific db column, show up at the entry of the fourth character in whichever box.
Then if they have chosen an existing value and they move to the second box, it automatically shows the possible matches before they type anything. And having made that entry in box 2, the possible list ofr box three shows when they click on that textbox.
I suppose it could be described as a multi combo box drop down, except it's with textboxes instead of 'selects'.
here's the form
<form action='/cgi-bin/script.pl' method='get'>
<input type='textbox' name='group_name' value ='' />
<input type='textbox' name='premises_name' value ='' />
<input type='textbox' name='business_name' value ='' />
<input type='hidden' name='action' value='submit' />
<input type='submit' value='Enter' />
</form>
And both in CF and in some tutorials, this is all I have managed to compile :(
I'm on a tight time schedule hence my mention of the work offers forum.
function create_ajax_request(){
this.xmlHttp;
try {
this.xmlHttp = new XMLHttpRequest();
}
catch (e) {
try {
this.xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
this.xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e) {
alert("Your browser does not support AJAX!");
return false;
}
}
}
}
function send_ajax_request_post(){
this.xmlHttp.open("POST", this.ssurl, true);
this.xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
this.xmlHttp.setRequestHeader("Content-length", this.pdata.length);
this.xmlHttp.setRequestHeader("Connection", "close");
this.xmlHttp.send(this.pdata);
this.xmlHttp.onreadystatechange = function(){
if (this.xmlHttp.readyState == 4) {
if (this.xmlhttp.status == 5) {
this.request_done();
}
}
};
}
Any help you can offer will be gratefully appreciated.
bazz