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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:39:03+00:00 2026-05-16T23:39:03+00:00

I have a simple form with 2 pull-down menus. What I can’t figure out

  • 0

I have a simple form with 2 pull-down menus. What I can’t figure out how to do is have a simple HTML link that will copy the selection from the first select menu to the second. The one caveat is that we don’t set ‘id’ on our form input fields so I need the JQuery object selection to be done using the ‘name’ field instead. Here is the HTML for the form:

<form action="/form/update" name="update-form" method="POST"> 

<select name="menu1_selection"> 
<option value="">-</option> 
<option value="1">1</option> 
<option value="2">2</option> 
<option value="3">3</option> 
<option value="4">4</option> 
<option value="5">5</option> 
<option value="6">6</option> 
<option value="7">7</option> 
<option value="8">8</option> 
<option value="9">9</option> 
<option value="10">10</option> 
<option value="11">11</option> 
<option value="12">12</option> 
</select>

<select name="menu2_selection"> 
<option value="">-</option> 
<option value="1">1</option> 
<option value="2">2</option> 
<option value="3">3</option> 
<option value="4">4</option> 
<option value="5">5</option> 
<option value="6">6</option> 
<option value="7">7</option> 
<option value="8">8</option> 
<option value="9">9</option> 
<option value="10">10</option> 
<option value="11">11</option> 
<option value="12">12</option> 
</select>

<a href="#" onclick="return false;" class="copyMenu1">copy</a>

</form>

And here is the JQuery I’m currently using that doesn’t work since it isn’t able to select the value from the first menu correctly:

<script type="text/javascript"> 
  $(document).ready(function() {  
    $("a.copyMenu1").click(function(){
        $("input[name='menu1_selection']").val($("input[name='hmenu2_selection']").val());
    });
  });
</script>

I’ve tried about 100 different ways and still can’t figure out the right way to select the value from the first menu and make the same selection from the second menu using the ‘name’ field selection. Thanks in advance for your help!

  • 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-16T23:39:04+00:00Added an answer on May 16, 2026 at 11:39 pm

    You need a <select> element selector instead, like this:

    $(function() {  
      $("a.copyMenu1").click(function(){
        $("select[name='menu1_selection']").val($("select[name='menu2_selection']").val());
      });
    });
    

    Also there was an extra h on the menu2_selection selector that needs removing, you can test it here. If you meant to copy any style input, you may have been after the :input selector.

    One note on the demo, like your code, this copies the second menu to the first, not the other way around, so make sure to set the second drop down, then click copy.

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

Sidebar

Related Questions

I have a simple form that looks like this: <%= simple_form_for @study,:url => studies_path,
I have a simple form for generating reports that I am adding a jqueryUI
I have a simple form that looks like so <% remote_form_for post, :url =>
I have a simple form that is used to update an entity in my
I have simple form. <form target=_blank action=somescript.php method=Post id=simpleForm> <input type=hidden name=url value=http://...> <input
I have simple form like this which accepts only two values string action and
Have a simple form (only extract fields here) but for some reason the JQserilization
I have this simple form which shows a pop up calendar when clicked on
I have a simple form like this : <form method=post name=change_pass id=change_pass action=change_pass2.php> <input
I have a simple form at my site which sends it data via Ajax

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.