title: CodeIgniter How to use onsubmit event in form_open()
body: <p>In HTML, I can call a javascript function like below</p>
  
  <pre><code> &lt;form type="post" onsubmit ="return test()" &gt;
   &lt;/form&gt;
  </code></pre>
  
  <p>How do I call the same javascript function in </p>
  
  <pre><code> form_open();
  </code></pre>
  
  <p>When form gets posted, I want function test to be called. How do I do above in CodeIgniter?</p>
  
  <p><strong>Update</strong></p>
  
  <p>x.html is my HTML page</p>
  
  <pre><code>   &lt;form&gt;
      &lt;/form&gt;
  
      &lt;?php $data = array('submit'=&gt;"test()");
     echo form_open(x,$data);
    echo  form_close();
      ?&gt;
  </code></pre>