?
Solved

Sending a drop down list value using GET

Posted on 2007-10-09
4
Medium Priority
?
1,923 Views
Last Modified: 2013-12-13
Hi - You'll have to bear with me because I really am probably the most inexperienced person in doing this...

I'm populating a drop down list on a form using an SQL query.  When the user clicks 'go' I want to send the selected option over to the next page using GET.  The problem I'm encoutering is that the page loads but no value is sent.  I can add it manually to the URL and it works but it's not appearing automatically.

The code is as follows:

echo "<center>Marshals Found</center><br>";
echo "<form name='pickteam' id='pickteam' action='view_marshals.php' method='GET'>Pick team to view Marshals: <select name='team' value=''>";
// printing the list box select command

while($nt=mysql_fetch_array($result)){//Array or records stored in $nt
echo "<option value=$nt[id]>$nt[team]</option>";
/* Option values are added by looping through the array */
}
echo "</select> <INPUT TYPE='submit' VALUE='Go!'>";// Closing of list box

Cheers!
0
Comment
Question by:llantwit
  • 3
4 Comments
 
LVL 11

Expert Comment

by:Isisagate
ID: 20040688
Everything looks right, your submit button is within the form right?
0
 
LVL 11

Expert Comment

by:Isisagate
ID: 20040699
wait...


 name='team' value=''>

change that too

 name='team'>
0
 
LVL 11

Accepted Solution

by:
Isisagate earned 1500 total points
ID: 20040707
putting the value attribute on a select box is not needed, and it probably forces the browser to send blank no matter what is selected.
0
 
LVL 28

Expert Comment

by:gamebits
ID: 20040731
try removing the empty value in the select tag

<select name='team' value=''> change for

<select name='team'>
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This article discusses how to implement server side field validation and display customized error messages to the client.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses
Course of the Month17 days, 2 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question