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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:43:09+00:00 2026-05-19T12:43:09+00:00

I’m using jQuery and coldfusion. Scenario: I have a database of vehicles and a

  • 0

I’m using jQuery and coldfusion.

Scenario:
I have a database of vehicles and a form to update the location of each vehicle. Let’s say I have 10 vehicles that are going to the same location. I’d like to be able to select a location from the drop down item and then click another button to copy that selected value to the other 9 vehicles.

I wasn’t able to get it to work in my main form so I created the code below to try out some things. I’m able to get the unique ID and the value from the select corresponding to the button clicked but I cannot get the other select lists values to udpate as written. Can anyone help?

<form>
    <select name="thisone" class="replicated" id="SystemType_10">
        <cfoutput>
            <cfloop index="x" from="1" to="10">
                <option value="Item #x#">Item #x#</option>
            </cfloop>
        </cfoutput>
    </select><img src="../iPhone/assets/images/whiteButton.png" width="29" height="46" border="0" align="absmiddle" class="vtip replicate" id="replicate_10" title="Copy this value down the list.">
    <br>
    <select name="thistwo" class="replicated" id="SystemType_500">
        <cfoutput>
            <cfloop index="y" from="1" to="10">
                <option value="Item #y#">Item #y#</option>
            </cfloop>
        </cfoutput>
    </select> <img src="../iPhone/assets/images/whiteButton.png" width="29" height="46" border="0" align="absmiddle" class="vtip replicate" id="replicate_500" title="Copy this value down the list." />
    <br>
    <select name="thisthree" class="replicated" id="SystemType_84">
        <cfoutput>
            <cfloop index="z" from="1" to="10">
                <option value="Item #z#">Item #z#</option>
            </cfloop>
        </cfoutput>
    </select> <img src="../iPhone/assets/images/whiteButton.png" width="29" height="46" border="0" align="absmiddle" class="vtip replicate" id="replicate_84" title="Copy this value down the list." />
</form> 

jQuery(document).ready(function() { //start of jQuery
    $('.replicate').click(function() {
        var CopybtnClicked = $(this).attr("id").split(""); // figure out which copy button was clicked and then get the ID number from it
        var sysID = CopybtnClicked[1]; // the value from using split are put into arrays starting with 0,1,2,3,etc. In this case
        // the value we need is the second so that is the ID we are looking for;
        var OriginalValue = $('#SystemType' + sysID).val(); // define the variable and then get the value from it;
        alert(OriginalValue);
        $("select option:contains('SystemType_')").val(OriginalValue);
        alert('done ' + OriginalValue);
    });
}) //end of jQuery
  • 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-19T12:43:10+00:00Added an answer on May 19, 2026 at 12:43 pm

    You were close, just needed to correct error with getting the sysID and the CSS selector syntax to find the other select boxes on the page.

    jQuery (my changes follow lines commented out using /* code */)

    jQuery(document).ready(function() { //start of jQuery
        $('.replicate').click(function() {
            /* var CopybtnClicked = $(this).attr("id").split(""); */
            var CopybtnClicked = $(this).attr("id").split("_"); // figure out which copy button was clicked and then get the ID number from it
            var sysID = CopybtnClicked[1]; // the value from using split are put into arrays starting with 0,1,2,3,etc. In this case
            // the value we need is the second so that is the ID we are looking for;
            var OriginalValue = $('##SystemType_' + sysID).val(); // define the variable and then get the value from it;
            alert(OriginalValue);
            /*$("select option:contains('SystemType_')").val(OriginalValue);*/
            $("select[id^='SystemType_']").val(OriginalValue);
            alert('done ' + OriginalValue);
        });
    }) //end of jQuery
    

    HTML (for commenter who requested it)

    <form>
        <select name="thisone" class="replicated" id="SystemType_10">
            <option value="Item 1">Item 1</option>
            <option value="Item 2">Item 2</option>
            <option value="Item 3">Item 3</option>
            <option value="Item 4">Item 4</option>
            <option value="Item 5">Item 5</option>
            <option value="Item 6">Item 6</option>
            <option value="Item 7">Item 7</option>
            <option value="Item 8">Item 8</option>
            <option value="Item 9">Item 9</option>
            <option value="Item 10">Item 10</option>
        </select><img src="../iPhone/assets/images/whiteButton.png" width="29" height="46" border="0" align="absmiddle" class="vtip replicate" id="replicate_10" title="Copy this value down the list.">
        <br>
        <select name="thistwo" class="replicated" id="SystemType_500">      
            <option value="Item 1">Item 1</option>
            <option value="Item 2">Item 2</option>
            <option value="Item 3">Item 3</option>
            <option value="Item 4">Item 4</option>
            <option value="Item 5">Item 5</option>
            <option value="Item 6">Item 6</option>
            <option value="Item 7">Item 7</option>
            <option value="Item 8">Item 8</option>
            <option value="Item 9">Item 9</option>
            <option value="Item 10">Item 10</option>
        </select> <img src="../iPhone/assets/images/whiteButton.png" width="29" height="46" border="0" align="absmiddle" class="vtip replicate" id="replicate_500" title="Copy this value down the list." />
        <br>
        <select name="thisthree" class="replicated" id="SystemType_84"><        
            <option value="Item 1">Item 1</option>
            <option value="Item 2">Item 2</option>
            <option value="Item 3">Item 3</option>
            <option value="Item 4">Item 4</option>
            <option value="Item 5">Item 5</option>
            <option value="Item 6">Item 6</option>
            <option value="Item 7">Item 7</option>
            <option value="Item 8">Item 8</option>
            <option value="Item 9">Item 9</option>
            <option value="Item 10">Item 10</option>
        </select> <img src="../iPhone/assets/images/whiteButton.png" width="29" height="46" border="0" align="absmiddle" class="vtip replicate" id="replicate_84" title="Copy this value down the list." />
    </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a text area in my form which accepts all possible characters from
I have thousands of HTML files to process using Groovy/Java and I need to
I have a reasonable size flat file database of text documents mostly saved in
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and

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.