title: Redirect to a page according to selected option from radio button through 'onclick' , without 'submit' the form in php
body: <p>This is the code which is not working according to my requirement</p>
  
  <pre><code>&lt;head&gt;
  
  &lt;script type="text/javascript"&gt;
  
  function test(){
  
  if(document.form.choice.value='pc'){
  
  window.open('pc.php','_self');
  
  return true;
  
  }
  
  else if(document.form.choice.value='ps2'){
  
  window.open('ps2.php','_self');
  
  return true;
  
  }
  
  else if(document.form.choice.value='ps3'){
  
  window.open('ps3.php','_self');
  
  return true;
  
  }
  
  else if(document.form.choice.value='psp'){
  
  window.open('psp.php','_self');
  
  return true;
  
  }
  
  }
  
  &lt;/script&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  
  Games&lt;br /&gt;&lt;br /&gt;
  
  &lt;form name="form"&gt;ALL &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  
  &lt;input type="radio" onClick="test()" name="choice" value="pc"&gt;PC &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  &lt;input type="radio" onClick="test()" name="choice" value="ps2"&gt;PS2 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  &lt;input type="radio" onClick="test()" name="choice" value="ps3"&gt;PS3 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  &lt;input type="radio" onClick="test()" name="choice" value="psp"&gt;PSP &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
  &lt;/form&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p>Also i want to know that how to display the field automatically just by selecting the selected field in Drop down list without 'submit'</p>
  
  <pre><code>&lt;select name="genre"&gt;
          &lt;option value=""&gt;--Select Genre and Click Go--&lt;/option&gt;
          &lt;option value="All"&gt;All&lt;/option&gt;
          &lt;option value="Action / Mission"&gt;Action / Mission&lt;/option&gt;
          &lt;option value="Arcade"&gt;Arcade&lt;/option&gt;
          &lt;option value="Racing"&gt;Racing&lt;/option&gt;
          &lt;option value="Sports"&gt;Sports&lt;/option&gt;
          &lt;option value="Kids"&gt;Kids&lt;/option&gt;
          &lt;option value="Strategy"&gt;Strategy&lt;/option&gt;
          &lt;option value="Adventure"&gt;Adventure&lt;/option&gt;
        &lt;/select&gt;
  </code></pre>