title: validate combobox in javascript
body: <p>I have written the below code. But it does not show me the alert message when I don't select the other value and click onto the submit button.
  I don't want to use <code>getElementbyId</code>. I am using the name attribute of the HTML.</p>
  
  <pre><code>&lt;HTML&gt;
  &lt;HEAD&gt;
  &lt;TITLE&gt;ComboBox Validation&lt;/TITLE&gt;
  
     &lt;script Language="JavaScript"&gt;
  
     function validate()
     {
  
        if (document.comboForm.technology.value=="0") \
       {
           alert("Please Select Technology");
       }
  
     }
  &lt;/script&gt;
  &lt;/HEAD&gt;
  
  &lt;BODY&gt;
  
  &lt;form name="comboForm"&gt;
  &lt;select name="technology"&gt;
      &lt;option value="0"&gt;Select&lt;/option&gt;
      &lt;option value="1"&gt;Java Server Pages&lt;/option&gt;
  &lt;/select&gt;
  
    &lt;input type="submit" value="submit" onClick="validate();"&gt;
  &lt;/form&gt;
  
  &lt;/BODY&gt;
  &lt;/HTML&gt;
  </code></pre>