Community Forums › Forums › Archived Forums › Design Tips and Tricks › Combo Box Drop Down
Tagged: categories, drop down
- This topic has 9 replies, 2 voices, and was last updated 11 years, 4 months ago by dev.
-
AuthorPosts
-
May 18, 2013 at 1:54 pm #41527erinakongMember
I am trying to insert a combo box drop down/item list into my page.
I couldn't find a plugin to do this....does anyone know of one?
I tried to build it myself, but I could not work out how to direct to another page once that 'value has been selected.
Take a look here.
http://carriedebuys.com/test-for-drop-box/
Can anyone help?
Thanks in advance
http://carriedebuys.com/test-for-drop-box/May 19, 2013 at 2:30 pm #41655devParticipantI don't know where you got the HTML code for what you did, but I'd do it this way:
<select id="mySelect" onchange="if(this.options[this.selectedIndex].value != ''){window.top.location.href=this.options[this.selectedIndex].value}">
<option value="">Select Below</option>
<option value="http://www.google.com">Google</option>
<option value="http://www.yahoo.com">Yahoo</option>
<option value="http://www.hotmail.com">Hot Mail</option>
</select>May 19, 2013 at 2:48 pm #41664erinakongMemberThanks so much for your help. I am going to try it now.
May 19, 2013 at 2:54 pm #41667erinakongMemberI just coped your code. It doesn't seem to work....?
May 19, 2013 at 3:04 pm #41670devParticipantHmmm. It works for me on a test page:
http://newmediawebsitedesign.com/wp2/test-2/
Are you putting the HTML in one of the Agent Press's widgets? Try it on a plain old page and see if it works.
I see your code in the page...
<div class="entry-content"> <select id=”mySelect” onchange=”if(this.options[this.selectedIndex].value != ”){window.top.location.href=this.options[this.selectedIndex].value}”> <option value=”">Select Below</option> <option value=”http://www.google.com”>Google</option> <option value=”http://www.yahoo.com”>Yahoo</option> <option value=”http://www.hotmail.com”>Hot Mail</option> </select> </div><!-- end .entry-content -->
Maybe the class "entry-content" is screwing things up? What does it style?
May 19, 2013 at 3:19 pm #41679erinakongMemberIt's not in a widget. i just cut and pasted it in to the html box. I inherited this site so I am not sure about....much....sorry. How can I find out?
May 19, 2013 at 3:41 pm #41688devParticipantWhat is an 'html box?"
Take a look at the class " dsidx-widget-search" and use that to style your drop down. That might work. It is in client.css
Without being able to login and seeing what you are doing, there isn't much more I can suggest.
May 19, 2013 at 3:48 pm #41690erinakongMemberI am more than willing to give you the log-in for you to check it out. I REALLY appreciate your time in helping me.
May 19, 2013 at 3:50 pm #41691devParticipantOne last guess... You copied my code? Perhaps your editor created "smart quotes":
<div id="content-sidebar-wrap"><div id="content" class="hfeed">
<div class="post-308 page type-page status-publish hentry"><h1 class="entry-title">Test for Drop box</h1>
<div class="entry-content">
<select id=”mySelect” onchange=”if(this.options[this.selectedIndex].value != ”){window.top.location.href=this.options[this.selectedIndex].value}”>Uncaught SyntaxError: Unexpected token ILLEGAL
<
Check the quote marks in YOUR code to make sure they are OK.... "mySelect and !=" etc.When I ran your code under Chrome Resources I get "Unexpected token ILLEGL" It's a syntax error... so there is some junk in the code... my bet is is the quotes.
May 19, 2013 at 3:52 pm #41693devParticipantThis reply has been marked as private. -
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.