Jump to content

auto drop down list not working correctly


kamesh192

Recommended Posts

Hi

i have a drop down list on http://www.mantle.co.uk/development.php?ID=1,

there are 2 different types of projects; developments and investments. the drop down lists all the projects (developments and investments), so if a user is on development.php and then selects an investment project, then he/she should be taken to investment.php with the correct investment project loaded up (with the use of passing the projID). Each project has a category field, so if the user selects an investment project, then i need the drop down list to pass the category (from the recordset) to the form action and then that will load the correct page (please see code, form action section).

the is problem is that the list is only passing the ID of the project, we need it to pass another field (category) too as when you select a project i need the user to be taken to another page which is dynamically loaded- depends which project the user selects.

hope ive made sense, please feel free to ask me any questions as any help would be great.

here is my code :
rsOtheDevs:
$query_rsOtherDevs = "SELECT * FROM tbProjects";

Form:

<form action="<?php print $row_rsOtherDevs['category']; ?>.php" method="get">
<label for="menu"></label>

<p>
<select id="menu" name="ID" class="dropdown" onchange="this.form.submit()">
<option value="" selected="selected">Jump To Another Project</option>
<?php
do {
?>
<option value="<?php echo $row_rsOtherDevs['projID']?>"><?php echo $row_rsOtherDevs['title']?> </option>
<?php
} while ($row_rsOtherDevs = mysql_fetch_assoc($rsOtherDevs));
$rows = mysql_num_rows($rsOtherDevs);
if($rows > 0) {
mysql_data_seek($rsOtherDevs, 0);
$row_rsOtherDevs = mysql_fetch_assoc($rsOtherDevs);
}
?>
</select>
<noscript>
<input type="submit" value="Go" />
</noscript>
<label></label>
</p>
</form>


thanks

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.