title: How to image swap using forms and javascript
body: <p>So I'm trying to make a image swapping code using a form with 2 drop-down options.</p>
  
  <p>Its for color options for a item call it a widget, a exterior and interior color. I've been scratching my head on approaching this and made this code.</p>
  
  <p>Here is my HTML</p>
  
  <pre><code>&lt;img id="Imageholder" src="../images/placeholder.jpg" /&gt;
  &lt;form&gt;
  Interior Color:
  &lt;select name="covers"&gt;
  &lt;option value="or1"&gt;Orange&lt;/option&gt;
  &lt;option value="be1"&gt;Blue&lt;/option&gt;
  &lt;option value="rd1"&gt;Red&lt;/option&gt;
  &lt;option value="bk1"&gt;Black&lt;/option&gt;
  &lt;option value="gm1"&gt;GunMetal&lt;/option&gt;
  &lt;/select&gt;
  &lt;p&gt;Exterior Color:
  &lt;select name="wheels"&gt;
  &lt;option value="or2"&gt;Orange&lt;/option&gt;
  &lt;option value="be2"&gt;Blue&lt;/option&gt;
  &lt;option value="rd2"&gt;Red&lt;/option&gt;
  &lt;option value="bk2"&gt;Black&lt;/option&gt;
  &lt;option value="gm2"&gt;GunMetal&lt;/option&gt;
  &lt;/select&gt;&lt;/p&gt;
  &lt;button onclick="function(Imagechange)"&gt;Change&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>and here is my JS</p>
  
  <pre><code>// Place Holder
  var Pholder = document.getElementById("Imageholder");
  // The List
  var Imglist = [ 
  "Http://../images/imageOrOr.jpg,
  Http://../images/imageOrBe.jpg,
  Http://../images/imageOrRd.jpg,"
    ];
    // List Values
    var covers, wheels;
    // Interior Variables
   var be1, rd1, bk1, gm1, or1;
   // Exterior Variables
   var be2, rd2, bk2, gm2, or2;
  
  function Imagechange () {
  switch (covers,wheels) {
   case 0:
   if (covers = or1, wheels = or2) {
    Document.getElementbyId(Pholder) == Imglist[0];
   }
       break;
   case 1:
   if (covers = or1, wheels = be2) {
    Document.getElementbyId(Pholder) == Imglist[1];
   }
      break;
   case 2:
  
      break;
   }
  }
  </code></pre>
  
  <p>Not the whole thing but I think this should be enough to get what I'm trying to do.</p>
  
  <p>Unfortunately doesn't work with the proper links and everything so I'm not sure what is wrong.</p>
  
  <p>Ultimately I want is when people pick the 2 options and click the button the image will appear above it, and when changing options and click again change the picture to the options they selected.</p>
  
  <p>My knowledge of JavaScript is limited and equally the same with jquery but any ways to make this work or a better way would help me.</p>