title: Change image source based on asp:DropDownList selection
body: <p>I want to be able to change an image depending on what is selected in the drop down box...</p>
  
  <p>I have this JS code to change the image. Simplified of course.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          function changeImage()
          {
              var oDDL = document.all("ddlNAME");
              var NAME= oDDL.options[oDDL.selectedIndex].text;
  
              switch(NAME)
              {
                  case "Name":
                      document.getElementById("img").src="img1.png";
                      break;
                  case "Name2":
                      document.getElementById("img").src="img2.png";
                      break;
                  default:
                      document.getElementById("img").src="img3.png";
              }
          }
      &lt;/script&gt;
  </code></pre>
  
  <p>When I call this function I do it in my DDL implementation.</p>
  
  <pre><code>&lt;asp:DropDownList ID="ddlNAME" runat="server" OnTextChanged="changeImage()" &gt;
  </code></pre>
  
  <p>But for some reason the <code>changeImage()</code> is not firing. it is giving me an error saying</p>
  
  <pre><code>'changeImage' is not a member of 'ASP.default_aspx'
  </code></pre>
  
  <p>I know this is a noob question and it is something small... But this is my first day every using javascript so bear with me please. Thanks!</p>