I have a select list and want to capture the row selected to pass to another page. I can't quite get it to work.
If I have a list called 'lstID' and the user selects row 5 (value five).
The form link is page2.php?ID=<? echo $_POST['lstID']; ?>
what the link ends up being when submitted is page2.php?ID=five&submit=submit
Is there a good tutorial or reference or help?
Thanks
pass value from select list to new page
Moderator: General Moderators
- nickman013
- Forum Regular
- Posts: 764
- Joined: Sun Aug 14, 2005 12:02 am
- Location: Long Island, New York
feyd | Please use
And this is what it's trying to pass now:
http://xxx.com/page2.php?lstID=two&Submit=Submit+Query
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
This is the code:Code: Select all
<body>
<form action="page2.php?<? echo $_GET['lstID']; ?>" name="listingg" id="listingg">
<select name="lstID" id="lstID">
<option value="one">1</option>
<option value="two">2</option>
<option value="three">3</option>
<option value="four">4</option>
</select>
<input type="submit" name="Submit" >
</form>
</body>http://xxx.com/page2.php?lstID=two&Submit=Submit+Query
feyd | Please use
Code: Select all
andCode: Select all
tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]