There are probably a million ways to do this... here is one  :)
(note that the file should be named "fieldtest.php"

--
Regards,

Gary "SuperID" Huntress

=======================================================
FreeSQL.org offering free database hosting to developers
Visit http://superid.dyndns.org:8080/freesql/index.php



<html>
<body>
<script language=javascript>
 function copyfield()
 { var ind;
  ind=document.myform.myfield.selectedIndex;
  window.navigate("formtest.php?otherfield="
+document.myform.myfield[ind].text);
 }

</script>
<form name=myform>
<select name=myfield onchange=copyfield();>
<?
 $db = mysql_connect("localhost",$username,$password);
 $rs=mysql_db_query( $databasename, "select myfield from mytable");
  while($row=mysql_fetch_array($rs))
 {
  echo "<option>$row[0]</option>";
 }

?>
<p>
<input type=text name=otherfield value="<? echo "$otherfield";?>">
</form>
</body>
</html>






""Petra"" <[EMAIL PROTECTED]> wrote in message
9a8qou$bp3$[EMAIL PROTECTED]">news:9a8qou$bp3$[EMAIL PROTECTED]...
> I like to select data out of a drop down box in my form field from a mysql
> database. While I do that I also like that it reloads the page and put the
> relevant products of that drop down box in another field.
> Ex:
> Category 1
> Category 2
> Category 3
> are in the drop down box
> and when I choose
> Category 1
> I like to display another field which displays me all the products which
are
> in that categorie. I know it can be down just not to sure how?
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to