ajax dy.list-select-to popul. records in two other textboxs?
Posted: Fri Oct 26, 2007 9:51 pm
ie...
Id | cab | price | w1
1 | wall | $300 | $19
on my form I have three textboxes:
input1 is cab with autocomplete, input2 is price, & input3 is w1
The way I have it now works great, I type a few letters in input1, it pulls up a list, once cab is selected it populates input1 with cab and input2 with price.
I want to know once cab is selected, if it can populate input2 with price & input3 with w1 as well?
Im using the ajax dynamic list.
This is the php code for accessing the DB
[PHP]<?
$conn = mysql_connect("localhost","x","x");
mysql_select_db("x",$conn);
if(isset($_GET['getCabinetsByLetters']) && isset($_GET['letters'])){
$letters = $_GET['letters'];
$letters = preg_replace("/[^a-z0-9 ]/si","",$letters);
$res = mysql_query("select * from cabinets where cab like '".$letters."%'") or die(mysql_error());
#echo "1###select * from cabinets where cab like '".$letters."%'|";
while($inf = mysql_fetch_assoc($res))
{
echo = $inf["price"]."###".$inf["cab"]."|";
}
}
?>[/PHP]
Any help, much appreciated!!