On my site I have a drop down list & each option has its URL. When you select one of the options and click the button, the corresponding URL opens in the same tab.

**PROBLEM:**
My form works, BUT I need to have **2 separate forms** on the same page. Right now, only the first form is working. So if I click the button on the second form, it will bring results from the firm form. e.g. I have "Option A" selected on the first form, and "Option C" on the second. I click 'submit' on the second form but it opens a URL from "Option A" of the first form.

You can change my current code/script completely as long as both drop-downs work individually on the same page.

Here is the code:

HTML

```
<form class="spec-table" name="dropdown">
  <tr>
    <td>
      <input type="hidden" name="on0" value="This is my drop down" />
      This is my drop down
    </td>
  </tr>
  <tr>
    <td>
      <select name="selected" id="target" accesskey="E" class="spec-field1">
        <option selected value="URL-1">Option A</option>
        <option value="URL-2">Option B</option>
        <option value="URL-3">Option C</option>
        <option value="URL-4">Option D</option>
      </select>
    </td>
  </tr>
  <input type="button" class="button-spec" value="Visit Link!"
         onclick="goToNewPage(document.dropdown.selected)">
</form>

```

Javascript

```
function goToNewPage() {
  if(document.getElementById('target').value) {
    window.location.href = document.getElementById('target').value;
  }
}

```