Welcome to Dream.In.Code
Become an Expert!

Join 149,532 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,530 people online right now. Registration is fast and FREE... Join Now!




Changing a dropdown menu

 
Reply to this topicStart new topic

Changing a dropdown menu

syclone
3 Jul, 2007 - 12:04 PM
Post #1

New D.I.C Head
*

Joined: 9 Jun, 2007
Posts: 1


My Contributions
Hello
hopefully i can explain this

i have a simple classifieds program its made in php with html templates.

when you create an ad your given a choice of category via a drop down menu
you chose the category the press submit
(id like to keep this),

but when someone comes to view the ads they also have the same drop down menu and a submit button
( id like to change that),
it seems easier if all the catagories where all viewed at once (like links) then you just click strait on the category your interested in and go just like a hyperlink

however as it is now when you chose a category and press submit
it stays on the same page but displays a list of whatever category you chose
so i dont know where to send the links
i am able to make the categorys display like links using a href "address"
is the another way of making a link without an address but by clicking you your doing the same as submitting?

here is the piece of code im trying to mod.
CODE

<form id="form1" name="form1" method="post" action="">
                <select name="category" id="category">
                
                  <LOOP genderOptionDropdown>
                    <option value="{gender.option}">{gender.option}</option>
                  </LOOP genderOptionDropdown>
                    </select>
                            <input type="submit" name="Submit" value="Submit" />
                            <label></label>
              </form>




Thank you very much
any info will be appreciated
Connor
User is offlineProfile CardPM
+Quote Post

Martyr2
RE: Changing A Dropdown Menu
9 Jul, 2007 - 09:01 AM
Post #2

Programming Theoretician
Group Icon

Joined: 18 Apr, 2007
Posts: 5,655



Thanked: 313 times
Expert In: C/C++, Java, VB, VB.NET, C#, PHP, Web Development, HTML & CSS, Javascript

My Contributions
I am not entirely sure what you are attempting to do, but taking a stab in the dark I would say that you are wanting to use an event for the drop down like "onchange" which you could use for when someone selects an option int he drop down that it takes them to another page automatically.

You will want to setup the drop down something like this...

CODE

<select name="category" id="category" onchange="window.location.href= this.options[this.options.selectedIndex].value">
<option value="http://www.google.com">Google</option>
<option value="http://www.microsoft.com">Microsoft</option>
</select>


This will redirect you to the appropriate website for the option you select. This page can even be a page within your own site. Hopefully this is what you are looking for.

This post has been edited by Martyr2: 9 Jul, 2007 - 09:01 AM
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/7/09 09:01PM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month