Form selection fills out textarea's based on mysql db...
Posted: Sat Apr 15, 2006 9:36 am
feyd | Please use
Thanks, help would be wonderful. I've tried putting the values into an array in the loop then putting them up in onChange, that doesnt work, I tried doing mysql queries in the onChange part, that didnt work. Totally clueless.
-have a good one, Tony
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
hello all, been racking my brains on this one decided to finally chuck it up to the higher powers...
I have a SELECT form object that is filled by the name and address of elements in a database table.
When I SELECT one of these names & addresses, I want 3 corresponding textfields to be filled with more detailed information than just the name and address. The other information is vendor_number, sc_number, and brc_number.
Heres my snippet:Code: Select all
<SELECT ONCHANGE="this.form.vendor_number.value = ?????;
this.form.sc_number.value = ?????;
this.form.brc_number.value = ?????;">
<?php
$grab="SELECT * FROM vendor_table";
$result = mysql_query($grab);
print(" <OPTION SELECTED VALUE=\"00\">— Select a Vendor —\n");
while($row = mysql_fetch_array($result))
{
print(" <OPTION VALUE=$row[vid]>$row[name]\n,$row[address]\n");
}
print(" </SELECT>\n"); ?>Thanks, help would be wonderful. I've tried putting the values into an array in the loop then putting them up in onChange, that doesnt work, I tried doing mysql queries in the onChange part, that didnt work. Totally clueless.
-have a good one, Tony
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]