Thread: JavaScript - Form Drop Down List
Results 1 to 5 of 5
Related
-
Drop-down list last value should be remember Forum: HTML Forum
Replies: 0 -
selecting a single email address from a drop-down list. Forum: CGI Perl Forum
Replies: 4 -
How Do I Create A Music Drop-down List? Forum: HTML Forum
Replies: 1 -
javascript drop down menus prob Forum: Website Scripts Forum
Replies: 11 -
Setting cookies to remember drop down list Forum: Website Scripts Forum
Replies: 3
-
03-15-2004, 02:58 PM #1
JavaScript - Form Drop Down List
Hello, I am new to JavaScript and I am trying to develop a tool for my wife's work. Right now I am trying to figure out how to get all the users in a data base to show up in a drop down selection box in a form. This way if any new users are added between visits to the webpage the new users will be automatically added to the list.
Anyone have any direction for me to go or know where I mgiht find some help for this.
Thanks in advance.
Jeff Moore(TBird2424)
-
03-15-2004, 06:34 PM #2
Hi there,
Heres an example I found:
Code:<?php function generate_box() { $sql = "SELECT * FROM xxxx"; $result = mysql_query($sql); $entries = mysql_num_rows($result); for($n = 0; $n <= $entries; $n++) { $sql = "SELECT * FROM xxxx WHERE ID = $n"; $result = mysql_query($sql); while ($info = mysql_fetch_array($result)) { foreach( $info AS $key => $val ) { $$key = stripslashes( $val ); } $options .= "<option value=\"-1\">$name</option>"; $options .= "<option value=\"-1\"></option>"; } } return $options; } $options = generate_box(); ?> <form method="get" name="forum_select" action="search.php"><table cellspacing="0" cellpadding="0" border="0"> <tr> <td><span>Search By: <select name="by"> <? echo "$options"; ?> <input type="submit" value="go"></span></td> </tr> </table></form>
If one of our members helps you, please click theicon to add to their reputation!
No support via email or private message - use the forums!
Before you ask, have you Searched?
-
03-16-2004, 08:14 AM #3
Quiet Dean, I am a little confused here. Is this PHP code or JavaScript? What is the difference? Sorry but I am truely a Nooby on JavaScript and still learning the many different types of code.
-
03-16-2004, 09:32 AM #4
Hiya,
Its actually PHP. My bad, I paid no attention to where you had posted.
You cannot access a database using only JavaScript, unfortunately. But you can by using a server-side language like PHP. If you are on a windows server, you may be better off using ASP or ASP.net.If one of our members helps you, please click theicon to add to their reputation!
No support via email or private message - use the forums!
Before you ask, have you Searched?
-
03-16-2004, 10:34 AM #5
Thanks for the reply. At least that gives me a direction to go now.
Thanks for your help again.
[Hostdens] – Cheap Linux Cloud VPS | Cheap Windows VPS...
10-23-2019, 05:25 AM in Web Hosting Forum