how to create message inside a bootstrap modal at the time of inserting data using ruby on rails?

468 Views Asked by At

I am using rails 4 and bootstrap 3. On click submit button the details(From image: name, email,mobile) are saved in a database. At the same time I want to show a message(say "You are done") inside the modal instead of Form .How can I do this? I am attaching an image. Please share with me if any one have any idea.

enter image description here

My Codes are below:

     <div class="modal fade" id="myModal_investor" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
              <div class="modal-content">
                <div class="modal-header">
                  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                  <h4 class="modal-title">Fill The Details</h4>
                </div>
                <div class="modal-body">
                  <div class="row">
                    <div class="col-lg-12 head-bg1">


                <%= form_tag static_pages_investor_details_path, class: "form-horizontal" do  %>

                      <div class="form-group">                
                          <label class="control-label col-sm-3 col-lg-2"> Name</label>
                          <div class="col-sm-6 col-lg-6">
                          <%= text_field_tag "investor[name]", nil, type:"text", tabindex: "1", class: "form-control", pattern: "[!-~ ]{1,30}",  placeholder: 'Enter The Name',  required: true %>
                          </div>
                      </div>
                      <div class="form-group">                
                          <label class="control-label col-sm-3 col-lg-2"> Email</label>
                          <div class="col-sm-6 col-lg-6">
                          <%= text_field_tag "investor[email]", nil, type:"text", tabindex: "1", class: "form-control", pattern: "[!-~ ]{1,30}",  placeholder: 'Enter The email',  required: true %>
                          </div>
                      </div>
                      <div class="form-group">                
                          <label class="control-label col-sm-3 col-lg-2"> Mobile</label>
                          <div class="col-sm-6 col-lg-6">
                          <%= text_field_tag "investor[number]", nil, type:"text", tabindex: "1", class: "form-control", pattern: "[!-~ ]{1,30}",  placeholder: 'Enter The Mobile',  required: true %>
                          </div>
                      </div>
                      <div class="row">
                          <div class="actions">
                              <div class="col-sm-3 col-lg-2"></div>
                              <div class="col-xs-5 col-sm-3 col-lg-3">
                              <%= submit_tag 'Submit', :class => 'btn btn-warning btn-block', tabindex: "2" %>
                              </div>

                              <div class="col-xs-2 col-sm-3 col-lg-4"></div>
                          </div> 
                      </div>                     
                   <% end %> 

                  </div>
                </div>  

                </div>

              </div>
         </div>
    </div>


    <a data-toggle="modal" href="#myModal_investor"><button type="button"  class=" btn btn-primary"><span class="text">Enter</span></button></a>
0

There are 0 best solutions below