Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 628317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T19:37:25+00:00 2026-05-13T19:37:25+00:00

Dropdown In my site I have a set of SELECT dropdowns that are set

  • 0

Dropdown

In my site I have a set of SELECT dropdowns that are set up like this.

<OPTION class="addTitleTag">400</OPTION>

Search Box

There is also a search box that is like the following.

input type="text" class="textbox" onblur="search_SearchBlock_blur()" onfocus="search_SearchBlock_focus()" value="Search" name="g2_form[searchCriteria]" size="18" id="searchCriteria"

The Javascript

    jQuery(function() {
    jQuery('.addTitleTag').click(function() {
        titleText = jQuery(this).attr('text');
        jQuery("#searchCriteria").val(titleText);
        //$('#go_button').click(); //acts as if the search "go" button was clicked.
    });
});

The idea is when the Dropdown option is selected from the OPTION’s, it takes the text of that option and copies it into the searchbox. The user then press’s go on the searchbox to search for the text.This works fine in firefox. However, it does not fare well in Safari.I’m wondering what the issue is with it. I know that in a previous setup I did I used list tags (li) inside of an unordered list and safari seemed to be able to grab the text value fine. However, it does not grab the text from inside of the OPTION tag and I need to use the option tags in this case. I’m wondering if there is some sort of work around. Thank you!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T19:37:26+00:00Added an answer on May 13, 2026 at 7:37 pm

    You’ll want to get the select element’s current value when the select’s change event fires:

    $(".myselect").change(function(){
      $(".search").val( $(this).val() );
    });
    

    Online Demo: http://jsbin.com/apuba/edit

    Note that this method doesn’t require adding onblur or onfocus event-logic in your HTML itself. Instead, this will bind on its own provided you give it adequate selectors.

    <input type="text" name="search" class="search" />
    
    <select class="myselect" name="foo">
      <option>100</option>
      <option>200</option>
      <option>300</option>
    </select>
    

    Nothing further is needed in the HTML.

    Update

    You can bind multiple dropdowns to do this too. Suppose you have the following:

    <select id="product_1">
      <!-- options -->
    </select>
    
    <select id="product_2">
      <!-- options -->
    </select>
    

    You could bind up both of these with the following:

    $("#product_1, #product_2").change(function(){
      $(".search").val( $(this).val() );
    });
    

    Note that I add new drop-downs merely by modifying the selector.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On this site: http://www.rent-turkey-property.com/ I have it set so that when you select a
I have a model that looks like this class RSVP (models.Model): def __unicode__(self): return
Following dropdown: <select id='dropdown' name='dropdown' onchange='showChart(this.value)'> <option value=1>Foo</value> <option value=2>Bar</value> </select> Calls this javascript
So I have a dropdown list <select id=theSelectId> <option value=volvo>Volvo</option> <option value=saab>Saab</option> <option value=mercedes>Mercedes</option>
I have a dropdown list (FK) which I would like to set and display
I have this HTML dropdown: <form> <input type=text id=realtxt onkeyup=searchSel()> <select id=select name=basic-combo size=1>
I need same menu like on this site http://www.salesforce.com/aloha.jsp in wordpress theme. Multilevel dropdown
Dropdown list 1: <select name=ddlArea onchange=showState(this.value)> Dropdown list 2: <select name=ddlFType onchange=showState(this.value)> I want
I have a little dropdown menu similar <select> , which contolled from external js-function.
If you click the dropdowns at this site: http://ryanbent.com/ - I want each of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.