dynamic forms

admin

Administrator
Staff member
I want to have a form which uses the post method.
<form action="result.php" method="post">
i want to use two selects, the first being
a option list of table names and the second an option list of field names.
I would like to make the field names options group display the field names for the table selected in the first option group.

Tried using php
if ($option1 == "table1")
{
echo "<option value=http://www.phpbuilder.com/board/archive/index.php/\"field1\">field1";
}
else if ($option1 == "table2")
{
echo "<option value=\"field1\">field1";
}
etc..

can't get it too work, won't recognise $option1 unless you have posted the form.

any way to get the php to recognise the $option1 variable without submitting the form.

thanks
john
 
Back
Top