0

I need to save data of a form into database..It is simple for me with a submit button..But now here I need to save data at its different stages..Or I'm having different tabs for each stage.. How could I save data.? I'm using a next button in order to navigate from one tab to other and at last there is a submit button..How it is possible to save data while clicking the next button.?

Here is my form:

<div class="stepwizard col-md-offset-3">
    <div class="stepwizard-row setup-panel">
          <div class="stepwizard-step">
        <a href="#step-1" type="button" class="btn btn-primary btn-circle">1</a>
        <p>Step 1</p>
      </div>
          <div class="stepwizard-step">
        <a href="#step-2" type="button" class="btn btn-default btn-circle" disabled="disabled">2</a>
        <p>Step 2</p>
      </div>
          <div class="stepwizard-step">
        <a href="#step-3" type="button" class="btn btn-default btn-circle" disabled="disabled">3</a>
        <p>Step 3</p>
      </div>
        </div>
  </div>
      <?php
      $this->load->helper('form');
      $attributes=array('method'=>'post','id'=>'myform','class'=>'form-horizontal','role'=>'form');
      echo form_open("form_controller/insert",$attributes);
      ?>
    <div class="row setup-content" id="step-1">
          <div class="col-xs-6 col-md-offset-3">
        <div class="col-md-12">
              <h3> Step 1</h3>
              <div class="form-group">
            <label class="control-label">Name</label>
            <input  type="text" required="required" class="form-control"  />
          </div>
              <button class="btn btn-primary nextBtn btn-lg pull-right" type="button" >Next</button>
            </div>
      </div>
        </div>
    <div class="row setup-content" id="step-2">
          <div class="col-xs-6 col-md-offset-3">
        <div class="col-md-12">
              <h3> Step 2</h3>
              <div class="form-group">
            <label class="control-label">Age</label>
            <input maxlength="200" type="text" required="required" class="form-control" />
          </div>
              <button class="btn btn-primary nextBtn btn-lg pull-right" type="button" >Next</button>
            </div>
      </div>
        </div>
    <div class="row setup-content" id="step-3">
          <div class="col-xs-6 col-md-offset-3">
        <div class="col-md-12">
              <h3> Step 3</h3>
               <div class="form-group">
            <label class="control-label">Location</label>
            <input maxlength="200" type="text" required="required" class="form-control" />
          </div>
              <button class="btn btn-success btn-lg pull-right" type="submit">Submit</button>
            </div>
      </div>
        </div>
<?php echo form_close(); ?>
Hanan Ashraf
  • 518
  • 3
  • 7
  • 21

1 Answers1

1

There are several ways of creating multi step forms. Here are some of the useful posts:

How to Create a Multi-Step Form Using RhinoSlider

session-based PHP-multistep-form with mvc-pattern

Multi step/page form in PHP & CodeIgniter

Multiple step form ragistration in codeigniter

Multi-Step Forms and Data Submission in CodeIgniter

Community
  • 1
  • 1
Suyog
  • 2,472
  • 1
  • 14
  • 27