title: onchange event of select box
body: <p>I am using a selectbox to display the list of "enterpirses" from the database. But the onchange event is not triggering. But when i manually once put the value of querystring then it starts working. I dont understand why it is happening.</p>
  
  <p>I am new to javascript and php, kindly suggest me the solution to this.</p>
  
  <pre><code>&lt;select id="enterprisebox" onchange="javascript:valueselect()" &gt;
      &lt;option value="-"&gt;-&lt;/option&gt;
  
      &lt;?php foreach($enterprise as $val) { ?&gt;
      &lt;option value="&lt;?php echo $val['customer_id'];?&gt;"&gt;&lt;?php echo $val['customer_name']?&gt;
      &lt;/option&gt;
      &lt;? } ?&gt;
  
  &lt;/select&gt;
  </code></pre>
  
  <p>and my javascript is--</p>
  
  <pre><code>function valueselect()
  {
      var i = document.getElementById('enterprisebox');
      var p = i.options[i.selectedIndex].value;
      //alert(p);
      window.location.href = "channelinformation.html?selected="+p;
  }
  </code></pre>