[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4284: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3493)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4286: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3493)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4287: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3493)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 4288: Cannot modify header information - headers already sent by (output started at /includes/functions.php:3493)
www.dhtmlgoodies.com • View topic - ajax dy.list-select-to popul. records in two other textboxs?
Advertisement

ajax dy.list-select-to popul. records in two other textboxs?

Moderators: Calcifer, slothy

ajax dy.list-select-to popul. records in two other textboxs?

Postby Jodarecode » Fri Oct 26, 2007 9:51 pm

Ok, I have a database:
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!!
Jodarecode
 
Posts: 14
Joined: Fri Oct 26, 2007 9:37 pm

ajax dy.list-select-to popul. records in two other textboxs?

Postby Jodarecode » Sat Oct 27, 2007 6:10 pm

Yes, thats the effect I'm looking for. I myself tried to change the script in the ajax file by adding another inputOj.id _hidden1, but realized it doesn't hold specific to the bits of info passed.

Thank you for taking the time to look at this,
much appreciated!!
Jodarecode
 
Posts: 14
Joined: Fri Oct 26, 2007 9:37 pm

Postby Jodarecode » Sat Oct 27, 2007 6:42 pm

Thanks, I'll give it a try!! Looks adaptable, I'll post a working/not working reply in a couple of days

Thanks again!!
Jodarecode
 
Posts: 14
Joined: Fri Oct 26, 2007 9:37 pm

Postby Jodarecode » Sat Oct 27, 2007 7:42 pm

I got a little ahead of myself and decided to give it a try!!

Your simpler version did not work as it would not pull up the cab list.

I haven't tried this but maybe instead of:
echo = $inf["id"]."~".$inf["price"]."~".$inf["w1"]."###".$inf["cab"]."|";

it was this:
echo = $inf["id"]."~".$inf["cab"]."~".$inf["price"]."###".$inf["w1"]."|";
like you had it in your first version.

But either way I got your first version working great!!
was quite simple actually!:)

Thank you again. maybe someone else could use this script as a ajax-client-lookup mixed with ajax-dyamic-list where the client id is not typed but looked up.

Who knows!!

Thanks,
Jodarecode
Jodarecode
 
Posts: 14
Joined: Fri Oct 26, 2007 9:37 pm

Postby Jodarecode » Mon Oct 29, 2007 5:14 pm

Jodarecode
 
Posts: 14
Joined: Fri Oct 26, 2007 9:37 pm

Postby Jodarecode » Mon Oct 29, 2007 6:02 pm

Jodarecode
 
Posts: 14
Joined: Fri Oct 26, 2007 9:37 pm

Postby Jodarecode » Mon Oct 29, 2007 6:33 pm

Jodarecode
 
Posts: 14
Joined: Fri Oct 26, 2007 9:37 pm

Postby Jodarecode » Mon Oct 29, 2007 6:46 pm

Jodarecode
 
Posts: 14
Joined: Fri Oct 26, 2007 9:37 pm

Postby Jodarecode » Mon Oct 29, 2007 9:14 pm

Jodarecode
 
Posts: 14
Joined: Fri Oct 26, 2007 9:37 pm

Postby epohren » Tue Jun 10, 2008 9:59 pm

epohren
 
Posts: 1
Joined: Tue Jun 10, 2008 9:45 pm


Return to General questions regarding AJAX scripts

Who is online

Users browsing this forum: No registered users and 16 guests