validation of select option in javascript
<p>i am using select option through Struts HTML tags for a particular jsp. The values of the option are Yes and No. Here is the code. </p>

<pre><code>  &lt;select name="select" id='choice'&gt;
     &lt;option value="&lt;%YES%&gt;" selected&gt;&lt;%="YES"%&gt;&lt;/option&gt;
     &lt;option value="&lt;%=NO%&gt;"&gt;&lt;/option&gt;  
</code></pre>

<p>The value seen in the select option list by default will be YES. 
I am performing validation such that if no value is selected(as Selected property given on 'YES') and form is submitted, a alert should be thrown to select new value. Below is my code. </p>

<pre><code> if( document.form.select.value == "YES" )
 {
   alert( "Please select other value" );
   return false;
 }
 if( document.form.select.value == "NO" )
 {
   alert( "Please select other value" );
   return false;
 }
</code></pre>

<p>The above code is not validating properly. Can anyone suggest me some changes.
Thanks      </p>
