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

The Archive Base Latest Questions

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

On my website I would like to compare two companies with an image-chart/-graph. Each

  • 0

On my website I would like to compare two companies with an image-chart/-graph. Each company (and there are a few hundreds) has an ID like "000000" (6 digits). An image link for a chart could be "pic_000123_000456.peng" – that would compare the company with the id 000123 with the company 000456. I guess, that’s clear? I’ve already built this engine, it works without problems

Now I’d like to offer an easy page for user to choose for their own two individual Comparisons. For that I’d like to display two dropdownlists. Below the Image shell appear. I’ve found two snippets, which are going the right way. Hopefully someone could find a solution. That would be fantastic!

  1. The following jquery-code is displaying an image immediately after changing the dropdownlist (that works great):
<script src="http://code.jquery.com/jquery-latest.js"></script>
<select id="sel">
    <option value="">Please Select the companies the Logo</option>
    <option value="pic_000123_000456.png">Chart 1</option>
    <option value="pic_000789_000456.png">Chart 2</option>
    <option value="pic_000789_000123.png">Chart 3</option>
</select>
<br />
<img id="swapImg" src="pic_000000_000000.png">
<script>  
    $(document).ready(function() {
        $("#sel").change(function() {
            var imgUrl = $(this).val();
            $("#swapImg").attr("src", imgUrl);
        });
    });
</script>
  1. The next jquery-code is displaying two text-parts from two dropdownlists and bring them togther.
<script src="http://code.jquery.com/jquery-latest.js"></script>
<select name="image" id="image">
    <option value="pic_000123_">Company 1</option>
    <option value="pic_000789_">Company 2</option>
    <option value="pic_000789_">Company 3</option>
</select>
<select name="image" id="image">
    <option value="000456.png">Company 1</option>
    <option value="000456.png">Company 2</option>
    <option value="000123.png">Company 3</option>
</select>
<div id="#imagePreview"></div>
<script>    
    $(document).ready(function() {
        $("#image").change(function () {
            var str = "";
            $("select option:selected").each(function () { str += $(this).text() + ""; });
            $("div").html(str);
        })
        .change();
    });
</script>

So instead of the text-output in example 2 the image (like in example 1) should appear, but with the link-parts of the values of example 2.

  • 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:07:13+00:00Added an answer on May 27, 2026 at 9:07 am

    If I understand you correctly, you want to combine the values from the dropdowns to create the image name.

    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <select name="image1" id="image1">
      <option value="pic_000123_">Company 1</option>
      <option value="pic_000789_">Company 2</option>
      <option value="pic_000789_">Company 3</option>
    </select>  
    <select name="image2" id="image2">
      <option value="000456.png">Company 1</option>
      <option value="000456.png">Company 2</option>
      <option value="000123.png">Company 3</option>
    </select>  
    <img id="swapImg" src="pic_000000_000000.png">
    <script>    
    $(document).ready(function() {
      $("select").change(function () {
        var str = $("#image1").val() + $("#image2").val();
        $("#swapImg").attr("src", str);
      });
    });
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a few pages on my asp.net website that I would like to
I would like to cache my website with memcache as much as possible. There
Im Making a question for a website and would like the the correct /
I am looking to write a an asp.net website and would like a good
My client would like website visitors to embed videos in their profiles. We've suggested
I am building a website which I would like to behave responsively using CSS
I have an existing ASP.NET website which I would like to painlessly add CMS
I would like to publish a website using msbuild. Since I have a website
I would like to read a website asynchronously, which isnt possible with urllib as
I would like to develop a website with fully ajax navigation, but this means

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.