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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:24:00+00:00 2026-05-26T01:24:00+00:00

I have 3 color fields… for example. Color Finish Highlights Now when a user

  • 0

I have 3 color fields… for example.

  • Color
  • Finish
  • Highlights

Now when a user clicks the “Color” the image changes according to the color. When the user clicks “Finish” the finish changes, and the Color selection stays as they have chosen.. and so on.

I am trying to accomplish this in jQuery. I’m thinking of having a naming convention with the products.. something along the lines of “Product_Color_Finish_Highlights.jpg” then I would change the appropriate ‘piece’ of the filename in conjunction with the selection made. Then send the new filename as the ‘src’ of the ‘target_image’

I have written a few things like accordion menus, and other simple things, but nothing where I would need to change the source of the image. I have been reading now for a couple days, and just unable to wrap my head around a good starting point, or ‘plan of attack’ for this.

I don’t think I need to much help with the actual jQuery, but just rather.. where to begin?
How do I attack this?

  • 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-26T01:24:00+00:00Added an answer on May 26, 2026 at 1:24 am

    Start with this:

    $('#your-image-selector').attr('src', 'product_color_finish_or_whatever.jpg');
    

    Or, clarify a bit what you need and you’ll get more specific help.

    Entering guess mode. You hinted at something more conventions based. Suppose you had the following markup, possibly generated by a script:

    <div id="pickers">
      <select id="color">
        <option value="blue">
      </select>
      <img id="color-swatch"/>
    
      <select id="finish">
        <option value="blue">
      </select>
      <img id="finish-swatch"/>
    
      <select id="highlights">
        <option value="blue">
      </select>
      <img id="highlights-swatch"/>
    

    You could drive the img src tags with this:

    $('#pickers > select').bind('load change', function(){
      $(this).next().attr('src', 'Product_' + $(this).val() + '.jpg');
    });
    

    That doesn’t require any specific classes or IDs on anything–just that the selects be next to the imgs and that the img filename include the value from the picker.

    What’s that? You don’t want your images adjacent to the pickers? OK then, link the two together with the id convention of picker-id whatever and related image-id of whatever--swatch. Then this code will work:

    $('#pickers > select').bind('load change', function(){
      $('#' + $(this).attr('id') + '-swatch')
        .attr('src', 'Product_' + $(this).val() + '.jpg');
    });
    

    This should use that convention to find the image and update its src.

    None of these code samples has been tested but they should inspire something that works.

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

Sidebar

Related Questions

I have two selection fields; <label>Color:</label> <select id=color> <option value=red>Red</option> <option value=blue>Blue</option> </select> <label>Car:</label>
I have a table with 3 fields: color, fruit, date. I can pick 1
My scenario: I have one color background image JPG. I have one black text
Suppose I have 3 fields on a Silverlight based xaml page Color, Size and
In my form I have multiple select fields. See here http://jsfiddle.net/ZNShh/ Now I want
I have a 10M-row table product with fields like color (int), price (float), weight
What would be the easiest way to have the color of a text field
Anyone know why CSS provides color for text, but does not have font-color or
I have a background color applied to a ListView <style name=CKButtons> <item name=android:windowBackground>@color/window_background</item> </style>
Can we have alternate Row color to GtkMenu items? and how to increase menu

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.