Drop-down with auto fill

Need to create a drop down list that will automatically fill in and change the code that is output.

Example

Drop down will contain:

Site 1
Site 2
Site 3
Site 4

When Site 2 is selected, it will automatically change the web address in the code below:

<a href=“http://www.site2.com”><img src=“http://www.bannerflux.com/userbanners/838-1-6-1273948252.png” border=“0”></a>

If Site 3 is selected from the drop down it will change the code to:

<a href=“http://www.site3.com”><img src=“http://www.bannerflux.com/userbanners/838-1-6-1273948252.png” border=“0”></a>

Etc.

Can someone point me in the right direction? Hope this isn’t too confusing.

Something like this but that will work through a database:
http://dev.aol.com/accessibility/bestpractices/selectlist

I’m not sure what your after but are after code for drop down menu for a form, then when an option is selected it will open a new window opening a website (or what ever, e.g. - a banner)?

This sounds more like a JavaScript thing. Try looking into onChange/onFocus events, they should be able to achieve what you’re after.
For example (not tested, may contain mistakes!):

<select name="myBanner" onChange="javascript:changeCode(this.value)">
  <option value="1">Site 1</option>
  <option value="2">Site 2</option>
  <option value="3">Site 3</option>
</select>

You JS function should then look something like this:

function changeCode(siteID) {
  switch(siteID) {
    case 1:
      document.getElementById('yourOutputElement').value = '<a href.....';
      break;
    case 2:
      document.getElementById('yourOutputElement').value = '<a href.....';
      break;
    default:
      // This will get executed if none of the above is selected
      document.getElementById('yourOutputElement').value = '<a href.....';
  }
}