Repeat use of a js script fails
I'm stumped by what is happening. I have a country select box that I want to ensure a selection is made. The first entry has an empty string as a default value.
What I'm seeing is that if I click on the submit button, it works as expected.
Using the Back button and clicking on the submit button a third time, operates properly.
A fourth, fails.
and so on.
This is a snippet of the select list
<select name='country' id='selectcountry' class='copy'>
<option SELECTED value="">Select A Country</option>
// This function is called to ensure a country was selected
var objCountrySelected = document.getElementById('selectcountry');
if (objCountrySelected.value == '')
verifyCountrySelected = false;
alert('Please select a country.');
verifyCountrySelected = true;
objCountrySelected = null;
I've tried using this as the onSubmit function for the form, and as the onClick function for the Submit button. In either case, it fails the same way.
Any ideas what might be happening here?