I have a floating button which displays options: open box, close box, and/or print respectively.
But I have the problem that all the buttons print, that is, they send the one submit
of the form:
<form method="POST" action="views/modules/caja/reportecaja.php" >
<div class="row">
<div class="col-sm-12">
<div class="card">
<div class="card-header">
<h5 class="card-title" style="text-align: center;height: 10px;">DATOS DE SESION</h5>
</div>
<div class="card-body">
<div class="row">
<div class="col-sm-3">
<label>CAJERO.:</label>
</div>
<div class="col-sm-3">
<input type="hidden" name="nombre" value="<?php if (isset($_SESSION['username'])){echo $_SESSION['username'];}?>"/>
<label><?php if (isset($_SESSION['username'])){echo $_SESSION['username'];}?></label>
</div>
<div class="col-sm-3">
<label>HORA INICIO:<?php if (isset($_SESSION['inicio'])){echo $_SESSION['inicio'];}?></label>
</div>
<div class="col-sm-3">
<label>HORA FIN:<?php date_default_timezone_set("America/Argentina/Buenos_Aires");$horaactual=date("H:i:s"); echo $horaactual;?></label>
</div>
</div>
<div class="row">
<div class="col-sm-3">
<label> Efectivo:</label>
<label id="subtotal"></label>
</div>
<div class="col-sm-3">
<label>Cambio:</label>
</div>
<div class="col-sm-2">
<input class="form-control" type="text" name="cambio" placeholder="QUEDA EN CAJA" id="cambio"/>
</div>
<div class="col-sm-3">
<label>Total</label>
<label id="total"></label>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="card">
<div class="card-header">
<h5 class="card-title" style="text-align: center;height: 10px;">LISTADO DE MOVIMIENTOS DEL TURNO</h5>
</div>
<div class="card-body">
<div class="table-responsive" >
<table id="resumen" class="table table-hover">
<title>Comprobantes</title>
<thead class="thead-dark">
</thead>
<tfoot>
<tr>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tfoot>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="contenedor">
<button class="botonF11" id="opciones" data-container="body" data-toggle="popover" data-trigger="hover" data-placement="left" data-content="OPCIONES" style="color: black;">
<span><i class="fas fa-tasks"></i></span>
</button>
<button class="btn2 botonF2" id="abrircaja" data-container="body" data-toggle="popover" data-trigger="hover" data-placement="left" data-content="ABRIR CAJA" style="color: black;">
<span><i class="fas fa-lock-open"></i></span>
</button>
<button class="btn2 botonF3" id="cerrarcaja" data-container="body" data-toggle="popover" data-trigger="hover" data-placement="left" data-content="CERRAR CAJA" style="color: black;">
<span><i class="fas fa-lock"></i></span>
</button>
<button class="btn2 botonF4" id="es" data-container="body" data-toggle="popover" data-trigger="hover" data-placement="left" data-content="ENTRADA/SALIDA" style="color: black;">
<span><i class="fas fa-dollar-sign"></i></span>
</button>
<button class="btn2 botonF5" id="imprimir" data-container="body" data-toggle="popover" data-trigger="hover" data-placement="left" data-content="IMPRIMIR" style="color: black;">
<span><i class="fas fa-print"></i></span>
</button>
</div>
</div>
</form>
How can I include a button and only this one calls the form
.
I work with FPDF.
You can block it by JS with the onclick event, but don't worry if you don't know JavaScript, HTML allows us
onclick=""
to do an element, in this case a button, and doing aevent.preventDefault()
would be enough to not send the form. I leave the code below:If you want it whole I'll leave it here: