| | |
dropdown list need help
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Jul 2008
Posts: 39
Reputation:
Solved Threads: 0
hi all;
Sory for disturbanced, Im just newbie in PHP really needed your help Smiley, basically i have created three dropdown list. but I got a problem to display the value on selected category. here is my problem,
I create a three dropdown list which is passing each parameter, when I select the first dropdown list, the second and the third dropdown list is going to change base on the parameter I inputed, and alo it display the value base on get the id, which is i have no problem in my first selection, my problem is, when i select the value on second dropdown list I cannot display the value on for the second selector and desame with the third dropdown list.
here is my code..
<form id="myRegion" method="get" action="index.php">
<p>
<select name="select" style="width:200px" onchange="myRegion()">
<option value="all">Region</option>
<?php
$ForRegion=region::getAllRegion();
if (!isError($ForRegion)){
foreach ($ForRegion as $element => $value) {
echo '<option value="'.$value->Region_id.'"';
if ($value->Region_id==@$region)
echo ' selected="selected"';
echo '>'.$value->displayName.'</option>';
}
}
?>
</select>
<input type="hidden" name="menu" value="region"></input>
</p>
</form>
<form id="myProvince" method="get" action="index.php">
<p>
<select name="select" style="width:200px" onchange="myProvince()">
<option value="all">Province</option>
<?php
$ForProvince=province::getProvinceById($region);
if (!isError($ForProvince)){
foreach ($ForProvince as $element => $value) {
echo '<option value="'.$value->Province_id.'"';
if ($value->Province_id==@$province)
echo ' selected="selected"';
echo '>'.$value->displayName.'</option>';
}
}
?>
</select>
<input type="hidden" name="menu" value="province"></input>
</p>
</form>
<form id="myForm" method="get" action="index.php">
<p>
<select name="select" style="width:200px" onchange="formS()">
<option value="all">All cities</option>
<?php
$cities=city::getCitiesById($region);
if (!isError($cities)){
foreach ($cities as $element => $value) {
echo '<option value="'.$value->City_id.'"';
if ($value->City_id==@$city)
echo ' selected="selected"';
echo '>'.$value->displayName.'</option>';
}
}
?>
</select>
<input type="hidden" name="menu" value="city"></input>
</p>
</form>
hope anyone can help me. because I lost my power
Sory for disturbanced, Im just newbie in PHP really needed your help Smiley, basically i have created three dropdown list. but I got a problem to display the value on selected category. here is my problem,
I create a three dropdown list which is passing each parameter, when I select the first dropdown list, the second and the third dropdown list is going to change base on the parameter I inputed, and alo it display the value base on get the id, which is i have no problem in my first selection, my problem is, when i select the value on second dropdown list I cannot display the value on for the second selector and desame with the third dropdown list.
here is my code..
<form id="myRegion" method="get" action="index.php">
<p>
<select name="select" style="width:200px" onchange="myRegion()">
<option value="all">Region</option>
<?php
$ForRegion=region::getAllRegion();
if (!isError($ForRegion)){
foreach ($ForRegion as $element => $value) {
echo '<option value="'.$value->Region_id.'"';
if ($value->Region_id==@$region)
echo ' selected="selected"';
echo '>'.$value->displayName.'</option>';
}
}
?>
</select>
<input type="hidden" name="menu" value="region"></input>
</p>
</form>
<form id="myProvince" method="get" action="index.php">
<p>
<select name="select" style="width:200px" onchange="myProvince()">
<option value="all">Province</option>
<?php
$ForProvince=province::getProvinceById($region);
if (!isError($ForProvince)){
foreach ($ForProvince as $element => $value) {
echo '<option value="'.$value->Province_id.'"';
if ($value->Province_id==@$province)
echo ' selected="selected"';
echo '>'.$value->displayName.'</option>';
}
}
?>
</select>
<input type="hidden" name="menu" value="province"></input>
</p>
</form>
<form id="myForm" method="get" action="index.php">
<p>
<select name="select" style="width:200px" onchange="formS()">
<option value="all">All cities</option>
<?php
$cities=city::getCitiesById($region);
if (!isError($cities)){
foreach ($cities as $element => $value) {
echo '<option value="'.$value->City_id.'"';
if ($value->City_id==@$city)
echo ' selected="selected"';
echo '>'.$value->displayName.'</option>';
}
}
?>
</select>
<input type="hidden" name="menu" value="city"></input>
</p>
</form>
hope anyone can help me. because I lost my power
![]() |
Similar Threads
- Dropdown list in ASP.NET - How to get value selected (ASP.NET)
- Dynamic dropdown list (ASP.NET)
- Dropdown list Last value (ASP.NET)
- hi problem in dropdown list (ASP)
- Retrieving Multiple Columns into Dropdown List (ASP.NET)
- DropDown List (VB.NET)
- Feeding a value in a dropdown list to another dropdown list (PHP)
Other Threads in the PHP Forum
- Previous Thread: how can i learn web programming languages from the scratch
- Next Thread: htaccess to hide directory listing!
| Thread Tools | Search this Thread |
apache api array beginner binary body broken buttons cakephp checkbox class cms code cron curl database date date/time display dynamic ebooks echo email error file files folder form forms function functions global google href htaccess html image include insert ip javascript joomla limit link list login mail mediawiki menu mlm msqli_multi_query multiple mycodeisbad mysql navigation number oop parameter paypal pdf php phpincludeissue problem query radio random recourse recursion regex remote script search seo server sessions sms source sp space speed sql static subdomain syntax system table tag tutorial update upload url validator variable vbulletin video web webdesign white xml youtube





