 <div class="container col d-flex justify-content-center">
   <div class="row">
      <div class="col-lg-12">
         <div class="card shadow-lg p-3 mb-5 bg-white ">
            <div class="card-header">
               <h3> Tipo de Productos </h3>
            </div>
            <div class="card-body">
               <!-- COMIENZO DEL FORMULARIO -->
               <form id="createform" action="/links/create-tipoproductos" method="POST" class="needs-validation" novalidate>
                  <div class="form-row">
                     <!-- LABELS E INPUTS DEL LA PRIMERA FILA  -->

                     <!-- LABELS E INPUTS DE  LA FECHA -->

                    <div class="col-md-9 mb-3">
                      <label class="font-weight-bold" for="desformula">Descripcion</label> 
                      <div class="input-group">
                        <input class="form-control" type="text" placeholder="Descripcion" id="desarea"   name="descripcion"  value = ""  required>                     
                      </div>
                    </div>

                      <div class="input-group">
                        <input type="hidden"  style="text-align:right;" class="form-control" placeholder="" name="tipo_de_submit"  value=0 >
                      </div>

                  </div> <!-- FIN DE LABELS E INPUTS DEL LA PRIMERA FILA  -->

                  <div class="form-row">
                    <div class="form-row">
                            <div class="col-md-6 mb-3">
                                <label class="font-weight-bold"        for="formula">Ruta de Producción</label>
                                <select name="ruta" class="custom-select"     >
                                {{#each lista}}
                                {{#each lista_rutas}}
                                    <option value={{id_ruta}}>{{descripcion}}</option>
                                {{/each}}
                                {{/each}}
                                </select>
                            </div>
                          <div class="col-md-4 mb-3">
                                <label class="font-weight-bold" for="desformula">Unidad de Presentación</label> 
                                <div class="input-group">
                                    <input class="form-control" type="text"  id="idpresentacion"   name="unidad_presentacion"  >                     
                                </div>
                          </div>
                    </div>                      
                     <!-- COMIENZO DE la CUARTA linea ROW-->
                            <div class="col-md-8 mb-3">
                              <div class="input-group">                               

                              </div>
                            </div>
                            <div class="col-md-2 mb-3">
                              <div class="input-group">                               
                               <button class="btn btn-success"  onclick= "cambiarstatus(0)"  type="submit">Save</button>
                              </div>
                            </div>
                            <div class="col-md-2 mb-3">
                              <div class="input-group">                               
                                <button id="btnCrear"    class="btn btn-danger" onclick= "cambiarstatus(1)"  >Close</button>
                              </div>
                            </div>
                  </div>


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

<script>
   function cambiarstatus(valor) {
      document.getElementsByName('tipo_de_submit')[0].value = valor;
   }
</script>

<script>

   (function () {
      'use strict';
      window.addEventListener('load', function () {
         // Fetch all the forms we want to apply custom Bootstrap validation styles to
         var forms = document.getElementsByClassName('needs-validation');
         // Loop over them and prevent submission
         var validation = Array.prototype.filter.call(forms, function (form) {
            form.addEventListener('submit', function (event) {
               if (form.checkValidity() === false) {
                  if (parseInt(document.getElementsByName('tipo_de_submit')[0].value) <= 0) {
                      event.preventDefault();
                      event.stopPropagation();
                  }
               }
               form.classList.add('was-validated');
            }, false);
         });
      }, false);
   });


</script>
