-
March 5th, 2009, 07:32 PM
#1
How to return a result from a drop down listbox in HTMl?
Hello.
Creating the box is easy enough.
<select><option> etc. etc. etc.
If you create the list box in a form, how do you return a result when someone clicks submit.
I'm already using PHP to read the listbox data out of mysql, but that won't be useful, because it runs on the server side, and by the time the user clicks the box and hits submit, the server has already calculated.
I'd prefer not to use Java or client side scripts but will if absolutely necessary.
-
March 6th, 2009, 07:28 AM
#2
Re: How to return a result from a drop down listbox in HTMl?
Depends on whether you are using get or post as your method. Below is an example of post.
PHP Code:
<?php $select = $_POST['select_tag_name']; ?>
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
March 19th, 2009, 11:13 AM
#3
Re: How to return a result from a drop down listbox in HTMl?
there is no difference in submitting a Edit/Input field or a Drop-Down-List selection
form.html
PHP Code:
..............
<form action="submit.php" method="post">
<select name="dropdown">
<option value="test1">test 1</option>
<option value="test2">test 2</option>
<option value="test3">test 3</option>
</select>
<input type="submit" />
</form>
.............
submit.php
PHP Code:
..........
You selected <?php echo $_POST["dropdown"]; ?>.<br />
..........
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|