Getting selection from dropdown

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
JackD
Forum Commoner
Posts: 62
Joined: Sat Dec 12, 2009 6:25 pm

Getting selection from dropdown

Post by JackD »

All pages on our website have a header, a sidebar, and the mainform (body). In the sidebar, we need a dropdown such as:

Code: Select all

 
<form name="listselect" method="get">
<select name="List" id="NYT">
<option value=0>Hardback Fiction</option> 
<option value=1>Hardback Non-Fiction</option>
<option value=3>Paperback Fiction</option>
<option value=5>Paperback Non-Fiction</option>
</select>
</form> 
 
where the user can select an item from the list and we will display the selected items to match the user's choice. We do not want to refresh the entire page, and thus do not want to use "action='whatever.php'" in the <select> tag. We need to be notified the user has changed the selection in the dropdown, and the current value of "List" so we can display the proper items in the sidebar.

Is it possible to do this without going to javascript?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Getting selection from dropdown

Post by John Cartwright »

JackD wrote:Is it possible to do this without going to javascript?
Nope.

Moved to Javascript.
JackD
Forum Commoner
Posts: 62
Joined: Sat Dec 12, 2009 6:25 pm

Re: Getting selection from dropdown

Post by JackD »

Where is the javascript you move it to?
Thanks
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Getting selection from dropdown

Post by John Cartwright »

JackD wrote:Where is the javascript you move it to?
Thanks
I moved this thread to the Javascript forum.
Post Reply