/    Sign up×
Community /Pin to ProfileBookmark

ajax-dynamic-list to fill more than 1 textbox with more than 1 values?

Ok, I have a database:
ie…
Id | cab | price | w1

1 | wall | $300 | $19

on my form I have three textboxes:
input1 is [B]cab[/B] with autocomplete, input2 is [B]price[/B], & input3 is [B]w1[/B]

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 [B]cab[/B] and input2 with [B]price[/B].

[I]I want to know once cab is selected, if it can populate input2 with [B]price[/B] & input3 with [B]w1[/B] as well?[/I]

Im using the script from here:
[url]http://www.dhtmlgoodies.com/index.html?whichScript=ajax-dynamic-list[/url]

This is the php code for accessing the DB

[code=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”].”|”;
}

}
?>[/code]

Any help, much appreciated!!

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @Jodarecode spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...