How do I insert in the database for forms on the same page? [closed]

-1

I'm testing a form before putting it into production, because we already have a system that inserts the equity movement 1 to 1 and I'm trying to get the operator to do several at the same time, for example, will move 5 printers pro same place he does not have to do the process 5 times ...

thenitsayshowmanyproductswillmoveandclicksendandopensthedesirednumberofforms

Myquestionis:HowdoIdothatwhenheclicksthefirstrecordbuttonhedoestheupdateinthebankwithoutleavingthepageandifitdoesnotaskformuch,amessageappearsinsertedinthe'square'thatclickedtorecordbecausewhoisgoingtooperatethis,doesnothavemuchfacilitywithcomputers.Followthecode.

<?php$produtos=$_POST['produtos']?><?phpfor($i=0;$i<$produtos;$i++){#code...?><divclass="container">

  <br>

        <div class="row">

            <div class="col-sm-9">

                    <form>
                          <div class="form-group">
                            <label for="exampleInputEmail1">Patrimonio</label>
                            <input name="data[PessoaEmail][0][email_tipo_id]" required="required" id="PessoaEmail0EmailTipoId" type="text" class="form-control" id="exampleInputEmail1" aria-describedby="emailHelp" placeholder="Enter email">

                          </div>
                          <div class="form-group">
                            <label for="exampleInputPassword1">Teste</label>
                            <input type="text" class="form-control" name="data[PessoaEmail][0][email_tipo_id]" required="required" id="PessoaEmail0EmailTipoId" placeholder="teste">
                          </div>
                      <button type="submit" class="btn btn-success btn-sm">Gravar</button>

                    </form>

            </div>
            <div class="col-sm-3">




            </div>

        </div>

  <br>
    </div>

<?php } ?>
    
asked by anonymous 10.10.2018 / 14:22

2 answers

1

If your problem is only when you click the submit button you do not want the page to reload you can use the preventDefault ( ) , but if your question is otherwise, try to make it clearer so we can help you.

    
11.10.2018 / 16:01
0

takes the fields from within the form and uses ajax to send the data.

When you have a button type="submit" inside a form, whenever the button type="submit" is triggered, it will update the page and send the input data inside that form

    
11.10.2018 / 16:30