title: codeigniter before submit confirm popup box using javascript
body: <p>I need when I click the button for submit view popup box for confirmation and <strong>if I press ok, it will continue the submit and if cancel nothing will happen and close the box</strong></p>
  
  <p>here is my code,</p>
  
  <p><strong>code in the view form</strong></p>
  
  <pre><code>&lt;?php
      foreach($company_data as $row){
  ?&gt;
      &lt;h2&gt;Company Details.&lt;/h2&gt;
  
      &lt;?php echo form_open_multipart('site/update');?&gt;
      &lt;?php form_hidden('id', $row-&gt;code);?&gt;
      &lt;label&gt;Code : &lt;/label&gt; &lt;?php echo form_input('code',$row-&gt;code);?&gt;&lt;br/&gt;&lt;br/&gt;
      &lt;label&gt;Name : &lt;/label&gt; &lt;?php echo form_input('name',$row-&gt;name);?&gt;&lt;br/&gt;&lt;br/&gt;
      &lt;label&gt;Logo : &lt;/label&gt;&lt;input type="file" name="userfile"/&gt;&lt;br/&gt;&lt;br/&gt;
      &lt;label&gt;URL : &lt;/label&gt; &lt;?php echo form_input('url',$row-&gt;url);?&gt;&lt;br/&gt;&lt;br/&gt;
      &lt;label&gt;Description : &lt;/label&gt; &lt;textarea name="description" rows="4" cols="50"&gt;&lt;?php echo $row-&gt;description; ?&gt;&lt;/textarea&gt;&lt;br/&gt;&lt;br/&gt;
      &lt;input type="submit" name="submit" value="Update" onclick="update(&lt;?php echo $row-&gt;name;?&gt;)"/&gt;
      &lt;/form&gt;
  
      &lt;?php } ?&gt;
  </code></pre>