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

  • Home
  • SEARCH
  • 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 6217113
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:22:08+00:00 2026-05-24T07:22:08+00:00

I am making a form that has various select elements like this <select class=nace>

  • 0

I am making a form that has various select elements like this

<select class="nace">
<option value="no" selected="selected">No</option>
<option value="yes">Yes</option>
</select>

I am trying to write a jQuery snippet that will change the selection of all these selects of the class “nace”, so the slected values are all in unison. But I am struggling a bit with the functionality.
So far I have an event bound to a the changes on selects but cant quite get it right. Can anyone help me?

    $('.nace').change(function() {
        var selected = $(this).val();
        $('.nace option:selected="selected"' ).each(function(){
            $(this+' option[value='+$(this).value+']').attr('selected', 'selected');

        });
    }); 
  • 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-24T07:22:10+00:00Added an answer on May 24, 2026 at 7:22 am

    I would have said just this:

    $(document).ready(function() {
     $('.nace').change(function() {
            var selected = $(this).val();
            $('.nace' ).val(selected);
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This behavior is making me wonder about my sanity.. I have a form that
I am making a non-secure page that has an iframe for a secure form.
I'm making a form that has a checkbox that if checked will slide down
I'm making a simple form that is to step through a program iteratively. How
I'm having a little bit of trouble making a sticky form that will remember
I am making a custom form object in Django which has an overrided __init__
I've been making this login form in C# and I wanted to 'submit' all
I have a doctrine model that has a method getSomethingId() and I'm making something
I have a form that has many checkboxes (too many for it to make
I'm using Django 1.2.4. I have an admin class for a model that has

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.