I have a form with a LIst field(menu) item.
When I select an item I want it to automatically update instead of waiting until I press submit.
I tried to accomplish this with onChange()
I am very frustrated and have problem mixing php, HTML and javascript and ', " , and ;
What I ultimately want to do is to call the page.php with the values $cat and product but I don't know if this is possible.
My second option is to call a function but does that have to be a javascript or can it work with a php function as well...? and what do I write then???
<?php
$i=1;
print "<FORM method=GET action=page.php>";
print "<SELECT name=product onChange=showInfo()>";
while ($i < $num+1) {
$name=mysql_result($result,$i-1,"name");
print "<OPTION name=product choice value=$i onChange=showInfo()>$name</OPTION>";
$i++;
}
print "</SELECT>";
print "<INPUT type=hidden name=page value=info>";
print "<INPUT type=submit name=submit_button value=Visa>";
print "<INPUT type=hidden name=cat value=$cat>";
print "</FORM>";
if (session_is_registered("valid_user"))
echo "Valkommen $valid_user";
?>
Any help, very appreciated!!!