comparing values from drop down menus from form using javascript
<p>On my form I have used javascript to validate user input, however I would like to compare the values of two different drop down menus to check they aren't the same. 
Two drop down menus "Pick up location" and "Destination" contain exactly the same town names available for each, so the user can easily select the same town for both, which I don't want.
Any ideas how to achieve this if it's possible? Thanks</p>

<p>code:</p>

<pre><code>function validateFormOnSubmit(theForm) {
var reason = "";

reason += validatepickuplocation(theForm.pickuplocation);

if (reason != "") {
alert("Some fields need correction:\n" + reason);
return false;
}

return true;
}

function validatePickuplocation(fld) {
var pickuplocation = document.getElementById("pickuplocation");
var destination = document.getElementById("destination");

if (pickuplocation.options[pickuplocation.selectedIndex].value ==   destination.options[destination.selectedIndex].value) {
fld.style.background = 'Yellow';
error = "Make sure 'Pick up location' and 'Destination' are not the same locations.\n"
} else {
fld.style.background = 'White';
}
return error;
}
</code></pre>

<p>html:</p>

<pre><code>&lt;tr&gt;
&lt;td&gt;&lt;label for="pickuplocation"&gt;Pick up location:&lt;/label&gt;&lt;/td&gt;
&lt;td&gt;&lt;select name="pickuplocation" size="1"&gt;
&lt;OPTIONS&gt;
&lt;/select&gt;&lt;/td&gt;&lt;/tr&gt;

&lt;tr&gt;
&lt;td&gt;&lt;label for="destination"&gt;Pick up location:&lt;/label&gt;&lt;/td&gt;
&lt;td&gt;&lt;select name="destination" size="1"&gt;
&lt;OPTIONS&gt;
&lt;/select&gt;&lt;/td&gt;&lt;/tr&gt;
</code></pre>
