form problem

  • foodstyling
  • Novice
  • Novice
  • foodstyling
  • Posts: 16
  • Loc: Antwerp

Post 3+ Months Ago

I have a form with 2 parts. The first is a dynamic generated list box to select a categorie. The second is a text field. Now I want to pass the result from the first part to the second one and i can't find how to make it work. This is the code for the form:

Code: [ Select ]
<form method="post" action= "results%202.php">
    <div align="center">
     <select name = "catID" size = "1">
      <?

$query= " SELECT catID, catName FROM categories ORDER BY catID";

$result = mysql_query($query);

while($catID =mysql_fetch_array($result))
{
print("<OPTION VALUE =\"$catID[0]\">$catID[1]\n");

}
?>
     </select>
     <br />
     <br />
  Vul hier een ingredient in:<br />
  <br />
  <input name = "ingredienten" type = "text" />
  <input name="submit" type="submit" value= "zoek!" />
  <input name="reset" type = "reset" value= "zoek opnieuw!" />
    </div>
  </form>
  1. <form method="post" action= "results%202.php">
  2.     <div align="center">
  3.      <select name = "catID" size = "1">
  4.       <?
  5. $query= " SELECT catID, catName FROM categories ORDER BY catID";
  6. $result = mysql_query($query);
  7. while($catID =mysql_fetch_array($result))
  8. {
  9. print("<OPTION VALUE =\"$catID[0]\">$catID[1]\n");
  10. }
  11. ?>
  12.      </select>
  13.      <br />
  14.      <br />
  15.   Vul hier een ingredient in:<br />
  16.   <br />
  17.   <input name = "ingredienten" type = "text" />
  18.   <input name="submit" type="submit" value= "zoek!" />
  19.   <input name="reset" type = "reset" value= "zoek opnieuw!" />
  20.     </div>
  21.   </form>


Thanks in advance
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

Just add an <input type="hidden" name="whatever" value="whatever"> to your form.

With the fields & values you require :)
  • foodstyling
  • Novice
  • Novice
  • foodstyling
  • Posts: 16
  • Loc: Antwerp

Post 3+ Months Ago

Could you please specify what whatever means with the code i posted? I am realy new in this php stuff. Thanks
  • Axe
  • Genius
  • Genius
  • User avatar
  • Posts: 5739
  • Loc: Sub-level 28

Post 3+ Months Ago

Well, it's whatever you want to name the variable.
  • foodstyling
  • Novice
  • Novice
  • foodstyling
  • Posts: 16
  • Loc: Antwerp

Post 3+ Months Ago

Thanks, I got it

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 50 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.