freddixon Posted March 2, 2006 Share Posted March 2, 2006 Hi,I'm relatively new to HTML and PHP, but have been programming PLSQL for some years, and I am aware that this question might be simple, but if you don't know the answer... I am trying to produce a site that has two <select type> lists on one of the pages that are populated from the database. The first list works fine but to get the second one to work I need to send the result value from the first select to the PHP script that controls the second. I don't know if this can be done easily as I realise that PHP is server based and HTML / Java is local.Example of first select follows:<select name="first" id="first" onChange="price_up(flag_form.first.value)"><?php do{ ?><option value="<?php echo $row_rs_first_list['Category_ID']?>"><?php echo $row_rs_first_list['Category_Type']?></option><?php } while ($row_rs_first_list = mysql_fetch_assoc($rs_first_list)); $rows = mysql_num_rows($rs_first_list); if($rows > 0) { mysql_data_seek($rs_first_list, 0); $row_rs_first_list = mysql_fetch_assoc($rs_first_list); }?></select>The function "price_up" just displays the value of the select.Anybody got any advice? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/3899-php-mysql-and-html-select-menus/ Share on other sites More sharing options...
Barand Posted March 2, 2006 Share Posted March 2, 2006 Basically there are 3 ways1 ) phpon selecting from first, submit the page and refresh the second menu then redisplay page2 ) javascriptYou need to create js arrays of options for each of the options in the first menu. Use js to refresh the second menu from the corresponding array. (baaSelect in my sig works like this)3 ) xmlhttp requestsee [a href=\"http://members.aol.com/barryaandrew/xmlhttp/article.html\" target=\"_blank\"]here[/a] for examples Quote Link to comment https://forums.phpfreaks.com/topic/3899-php-mysql-and-html-select-menus/#findComment-13526 Share on other sites More sharing options...
freddixon Posted March 6, 2006 Author Share Posted March 6, 2006 Thanks for the help with the menus. Quote Link to comment https://forums.phpfreaks.com/topic/3899-php-mysql-and-html-select-menus/#findComment-14661 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.