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 6916677
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T09:38:01+00:00 2026-05-27T09:38:01+00:00

I have integrated jquery-asmselect and would like to be able to also select the

  • 0

I have integrated jquery-asmselect and would like to be able to also select the options using other links on the page. To visualize what I’m trying to do, you can view the page here

Here is the jquery code I’m using for asmselect:

$(document).ready(function() {
    $("#CategoryID").asmSelect({
        addItemTarget: 'bottom',
        animate: true,
        highlight: false,
        sortable: false
    }).after($("<a href='#' class='select-all'>select all neighborhoods</a>").click(function() {
        $("#CategoryID").children().attr("selected", "selected").end().change();
        return false;
    })); 
    $("#search_SubCategoryID").asmSelect({
        addItemTarget: 'bottom',
        animate: true,
        highlight: false,
        sortable: false
    }).after($("<a href='#' class='select-all'>select all cuisines</a>").click(function() {
        $("#search_SubCategoryID").children().attr("selected", "selected").end().change();
        return false;
    })); 
}); 
  • 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-27T09:38:02+00:00Added an answer on May 27, 2026 at 9:38 am

    First of all, you’ll need to identify in wich neighborhood you are clicking. Adding a rel (like in the options) might work:

    ...
    <li class="evillage">
        <a href="#" rel="asm0option0">East Village/LES</a>
    </li>
    ...
    

    Then, add this script:

    $(".search-map a").click(function(event) {
        event.preventDefault();
        var hood = $(this).attr('rel');
        var $option = $('option[rel=' + hood + ']');
    
        $option.change();
        return false; 
    });
    

    Based on this asmselect example. You just need to get the correspondig option depending on the clicked link, and then call the change(); trigger on it.

    EDITED:

    The above code failed big time 😛 Here’s the new version (With a working fiddle):

    $(".search-map a").click(function() {
    
        var $city = $(this).html();
        var $rel = $(this).attr('rel');
        var disabled = $('#asmSelect0 option[rel=' + $rel + ']:first').attr('disabled');
    
        if (typeof disabled !== 'undefined' && disabled !== false) {
            return false;
        }
    
        var $option = $('<option></option>').text($city).attr({'selected': true, 'rel': $rel});
    
        $('#asmSelect0').append($option).change();
        $('#asmSelect0 option[rel=' + $rel + ']:first').remove();
    
        return false; 
    }); 
    

    I had to do something I don’t really like, but I couldn’t find any other way of doing this without conflicting with the plugin. Anyway, it’s not that bad. Basically I get the name of the neighborhood, the rel to identify the option, generate a new <option>, change(); it, and delete the old option tag. The plugin didn’t like trying to change the tag itself without creating a new one… I had to add the if (...) thing because when adding a neighborhood (disabling it on the select), and clicking again on the same neighborhood, it enabled it on the select (And we don’t want that, since it’s already selected). With that condition, if we click on a link whose neighborhood is disabled, we’ll do nothing and the option will remain the same.

    Sorry if my explanation sucks, It took me a while to get the problem, I had to build everything up again, and I felt like having a lack of english xD Hope it works!

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

Sidebar

Related Questions

I have a jquery fullcalendar . I would like to trigger jquery QTip (or
I have been using Visual Studio integrated with Source Safe for years, when I
I have integrate jQuery thick box in Codeigniter, when I am using this thick
I would like to integrate jQuery-DatePicker in my web application. I downloaded the scrips,
Why isn't jQuery intergrated into browsers, so there would be no need to have
I have integrated jquery jeditable in my project. $(function() { $(.editable_textarea).editable(/articles/edit/, { indicator :
I am have integrated the colorbox jQuery Plugin into the Wordpress theme. But on
I have a jquery driven web application and a particular page on the site,
So I have an input which I integrated jQuery autocomplete. I don't know how
I am using jQuery mobile and MVC 2.0 for my mobile site. I have

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.