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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T08:22:37+00:00 2026-05-31T08:22:37+00:00

I have a dropdown option box in my CS-Cart install that has dynamically created

  • 0

I have a dropdown option box in my CS-Cart install that has dynamically created values, e.g. 3110, 3111, 3112, 3113….

I need to change an image below the dropdown based on the chose value from the dropdown.

I was looking at this script – http://www.javascriptkit.com/script/cut173.shtml but using that would depend on using manually created values. (see below for coding)

Script:

<script language="javascript">
<!--
function showimage()
{
if (!document.images)
return
document.images.pictures.src=
document.mygallery.picture.options[document.mygallery.picture.selectedIndex].value
}
//-->
</script>

HTML:

<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%"><form name="mygallery"><p>
<select name="picture" size="1" onChange="showimage()">
<option selected value="image1.gif">Picture of me</option>
<option value="image2.gif">Picture of my aunt</option>
<option value="image3.gif">Picture of my brother</option>
</select>
</p>
</form>
</td>
</tr>
<tr>
<td width="100%"><p align="center"><img src="image1.gif" name="pictures" width="99" height="100"></td>
</tr>
</table>

What do I need to do so it references the value in the dropdown? this Is for a one off product and only needs to be done for this one so there is no worries about values changing etc…

This is the code that is generated on the front end of the page that I need to associate the scripting to:

<select name="product_data[29821][product_options][742]" id="option_29821_742" onchange="fn_change_options('29821', '29821', '742');" >
<option value="">Choose...</option>                                                                     <option value="3111" >LC </option>
<option value="3110" >LC/A </option>
<option value="3112" >E2000 </option>
<option value="3113" >E2/A </option>
<option value="3114" >FC /option>
<option value="3115" >FC/A </option>
<option value="3116" >ST </option>
<option value="3117" >SC </option>
<option value="3118" >SC/A </option>
</select>
  • 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-31T08:22:38+00:00Added an answer on May 31, 2026 at 8:22 am

    Here’s what you need to do:

    function listen(event, elem, func) {
      if (elem.addEventListener) {
        elem.addEventListener(event, func, false);
      } else if (elem.attachEvent) {
        elem.attachEvent(event, func);
      }
    }
    
    var select = document.getElementById('picture'); // give your select element an ID for ease and speed of DOM traversal
    
    listen('change', select, function() {
      var val = this.options[this.selectedIndex].value;
      var image = new Image();
      image.src = val;
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dropdown box that has a list of institutions in it. Now
I have a dropdown box, It has no values in them. I have to
I have created one dropdown box <select name=select id=selectId> <option id= value=calendar_Second_Calendar_1285942672.xml>Second Calendar</option> <option
I have a while loop that populates a dropdown box with values from a
I have a page that I load a select dropdown box but I want
I have a dropdown box that I construct with PHP. Here is the code:
I have a normal HTML select dropdown box <select id=day name=day> <option value=0>All</option> <option
I have a dropdown box that is being populated by a filtered list of
I'd like to have a menu (select box replacement dropdown) that, when clicked, fades
I have a dynamically populated PHP dropdown menu that gathers the following information from

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.