Ihsaan Posted November 14, 2012 Share Posted November 14, 2012 I have a php dropdown box with items from the database but I cant figure out how to make the items in the dropdown link to the details pages of those specific items. So for example the 3rd item in the dropdown is "Joe", when selected it should display the page with Joe's details. <?php echo '<select name="Clients"><OPTION>'; echo "Select an option</OPTION>"; while ($row = mysql_fetch_array($client_select)){ $client_id = $row["client_id"]; $company_name = $row["company_name"]; echo "<OPTION value=\"$client_id\">$company_name</OPTION>"; } echo '</SELECT>'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/270663-php-mysql-jump-menu/ Share on other sites More sharing options...
Muddy_Funster Posted November 14, 2012 Share Posted November 14, 2012 You need to use javascript if you want to have page elements be interactive without the use of a submit button. If you haven't used any javascript before, and this is functionality that you expect to use a lot of, I'd recomend at some point soon that you get the JQuery library (free download and you just link the page header to it much as you would a css file) and looking up some online tutorials - nettuts has a series of video tutorials here if that's what you like. PHP doesn't interface directly with the user, it runs on the server side. As such it has no connection with mouse clicks or keyboard commands and it has no idea what values have been chosen or entered into forms untill they are sent back to the server. It can react conditionaly to a request from a web page (normaly via a submit button or a javascript function) and produce results accordingly, but it can't react to user input directly. Quote Link to comment https://forums.phpfreaks.com/topic/270663-php-mysql-jump-menu/#findComment-1392209 Share on other sites More sharing options...
thara Posted November 14, 2012 Share Posted November 14, 2012 Is there any error message with your select menu? If so, show us. If your select query ok, this code should be work... Quote Link to comment https://forums.phpfreaks.com/topic/270663-php-mysql-jump-menu/#findComment-1392210 Share on other sites More sharing options...
Muddy_Funster Posted November 14, 2012 Share Posted November 14, 2012 Is there any error message with your select menu? If so, show us. If your select query ok, this code should be work... Quote Link to comment https://forums.phpfreaks.com/topic/270663-php-mysql-jump-menu/#findComment-1392213 Share on other sites More sharing options...
Ihsaan Posted November 27, 2012 Author Share Posted November 27, 2012 The menu displays fine but now I need to it to go to the details page. I don't mind using a go button but how do i achieve it? Quote Link to comment https://forums.phpfreaks.com/topic/270663-php-mysql-jump-menu/#findComment-1395430 Share on other sites More sharing options...
Muddy_Funster Posted November 27, 2012 Share Posted November 27, 2012 let's see the full form code Quote Link to comment https://forums.phpfreaks.com/topic/270663-php-mysql-jump-menu/#findComment-1395439 Share on other sites More sharing options...
Muddy_Funster Posted November 27, 2012 Share Posted November 27, 2012 images arn't much use, post the actual code, between code tags, and I'll have a look at it Quote Link to comment https://forums.phpfreaks.com/topic/270663-php-mysql-jump-menu/#findComment-1395482 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.