Re: how do I send information to a php page from a menu list
| From: | lallous | Date: | Mon, 02 Sep 2002 14:22:52 +0000 |
| Subject: | Re: how do I send information to a php page from a menu list | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-114915@lists.php.net to get a copy of this message | ||
Hello Ivan,
<select name="selcategoryid" value="0">
Don't set a value for that tag!
echo "<option name=\"selcategoryid\"
value=\"$faqcatsid\">$faqcats</option>";
no need to "name" the <option> tag too, setting the value will be enough.
when you submit your form, faqbycat.php will receive $selcategoryid as the
user chose from that select list.
Elias,
"Ivan Carey" <icarey@bigpond.com> wrote in message
news:005801c2527c$dcb00260$0201a8c0@ivan...
Hello,
how do I send information to a php page from a menu list?
When a user selects an item from the list I would like to be able to send
"selcategoryid" to faqbycat.php without the use of a submit button.
Is it done by using the onChange event? if so how may this be done?
The code I am using presently is below
<form action="faqbycat.php">
<select name="selcategoryid" value="0">
<option name="selcategoryid" value="0" selected>Select a
Category</option>
<?php
//display list of provider names
while ($myrowcating=MySQL_fetch_array($resultcatdet))
{
$faqcatsid=stripslashes($myrowcating["breastfaqcatid"]);
$faqcats=stripslashes($myrowcating["breastfaqcat"]);
echo "<option name=\"selcategoryid\"
value=\"$faqcatsid\">$faqcats</option>";
}//while ($myrowadmintitles=MySQL_fetch_array($admintilteresult))
?>
</select>
<br><br>
<input type="Submit" name="selbycat" value="Show FAQ's by
Category">
</form>
Thanks for your answer,
Ivan