lunny Posted May 2, 2007 Share Posted May 2, 2007 Ok what I would like to do is have a select form which lists all my registered members which is no problem. What I would like is then that when they select a member below it information appears regarding that user. So ive looked into this and what id like to use is the javascript function onChange(); and div tags. For example I found this code online which im trying to edit to my needs : <html> <head> <title>Flower Order Form</title> </head> <body> <h3>Flower Order Form</h3> <form action="processorder.php" method="post"> <select id='numflowers' onChange="javascript: ShowMenu(document.getElementById('numflowers').value,'divColor', 6);"> <option value='0'>Number of Flowers ... <option value='5'>6 ... //whatever number of members </select> <div id='divColor1' style="display: none;"> //Display Database select statement info </div> <br> </form> </body> </html> This above code looks messy but it works as intended, the only thing i cant figure out is I need to save the value of currently selected value so i can query my database with that. i.e in php $value = select.value etc.. Quote Link to comment Share on other sites More sharing options...
suttercain Posted May 2, 2007 Share Posted May 2, 2007 Is this PHP or JavaScript? Quote Link to comment Share on other sites More sharing options...
lunny Posted May 2, 2007 Author Share Posted May 2, 2007 Hi, Sorry this is a PHP Application, but i thought I had to use Javascript for the onChange features ? Quote Link to comment Share on other sites More sharing options...
roopurt18 Posted May 2, 2007 Share Posted May 2, 2007 Yes, you do use Javascript for the onchange event. You should try posting this in the Javascript forum. Additionally you should do some learning on your own as Javascript can become quite messy and complicated in the hands of a novice. A link to the O'Reilly book I used to learn Javascript: http://www.amazon.com/JavaScript-Definitive-Guide-David-Flanagan/dp/0596101996/ref=sr_1_4/103-2697599-1496625?ie=UTF8&s=books&qid=1178131946&sr=1-4 A link to w3schools Javascript tutorial, which I refer to constantly when I don't have the O'Reilly book handy: http://www.w3schools.com/js/default.asp Quote Link to comment 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.