mayanksrmcem
09-01-2006, 02:02 AM
hello friends,
i've a problem in handling two comboboxes in a php page.
in one conbobox the name of countries is fill from database.
and in the other combobox,data is filled from database related to the select country on onchage event of first combo box
the first combo box is in first frame and other in sesond.
the submit button is in second form.
my problem is how can i get the value of aal controls present in the web page.
my code for this is as follows-----
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="GET" action="<? echo $_SERVER['PHP_SELF']; ?>">
<table>
<tr>
<td>
<select name="cb1" onchange="submit();">
<option>SELECT</option>
<?php
while($data=mysql_fetch_array($result))
{
?>
<option <? if(isset($_REQUEST['cb1']) && $con == $data["coun_name"]) { ?> selected <? } ?>><? echo $data["coun_name"]; ?></option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td>
<select name="cb2">
<option>SELECT</option>
<?php
if(isset($_REQUEST['cb1']))
{
while($data1=mysql_fetch_array($r1))
{
?>
<option><? echo $data1["city_name"]; ?></option>
<?php
}
}
?>
</select>
</td>
</tr>
</table>
</form>
<form name="form2" method="get" action="<? echo $_SERVER['PHP_SELF']; ?>">
<input type="text">
<input type="text">
<input type="text">
<input type="text">
<input type="submit">
</form>
</body>
waiting for your reply......
mayanksrmcem
i've a problem in handling two comboboxes in a php page.
in one conbobox the name of countries is fill from database.
and in the other combobox,data is filled from database related to the select country on onchage event of first combo box
the first combo box is in first frame and other in sesond.
the submit button is in second form.
my problem is how can i get the value of aal controls present in the web page.
my code for this is as follows-----
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="GET" action="<? echo $_SERVER['PHP_SELF']; ?>">
<table>
<tr>
<td>
<select name="cb1" onchange="submit();">
<option>SELECT</option>
<?php
while($data=mysql_fetch_array($result))
{
?>
<option <? if(isset($_REQUEST['cb1']) && $con == $data["coun_name"]) { ?> selected <? } ?>><? echo $data["coun_name"]; ?></option>
<?php
}
?>
</select>
</td>
</tr>
<tr>
<td>
<select name="cb2">
<option>SELECT</option>
<?php
if(isset($_REQUEST['cb1']))
{
while($data1=mysql_fetch_array($r1))
{
?>
<option><? echo $data1["city_name"]; ?></option>
<?php
}
}
?>
</select>
</td>
</tr>
</table>
</form>
<form name="form2" method="get" action="<? echo $_SERVER['PHP_SELF']; ?>">
<input type="text">
<input type="text">
<input type="text">
<input type="text">
<input type="submit">
</form>
</body>
waiting for your reply......
mayanksrmcem