I have a table with data and one of the fields has 1 edit button. What I want is that, when clicking, it opens me a modal with the data all filled out of the respective line that I clicked on. I already managed to do this, but it was not with a modal, it was with a file apart, and now I wanted a modal. Could they help me?
Modcode
<divclass="modal fade" id="large-Modal1" tabindex="-1" role="dialog">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title text-center text-primary"><i class="fa fa-user-plus"></i> Alterar Cliente</h4>
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<form id="edit_equipa" method="POST" action="clientes.php?edit=1" enctype="multipart/form-data">
<div class="modal-body">
<input type="hidden" name="action" value="executeEdit">
<input type="hidden" class="" name="alterar_cliente_id" id="alterar_cliente_id" value="<?php echo $row['cliente_id']; ?>">
<div class="form-group form-float col-lg-12">
<label><strong>ID Cliente</strong></label>
<div class="form-line">
<input type="text" class="form-control" disabled required ><?php echo $row['cliente_id']; ?></input>
</div>
</div>
<div class="form-group form-float col-lg-12">
<label><strong>Nome</strong></label>
<div class="form-line">
<input type="text" class="form-control" name="alterar_nome" id="alterar_nome" value="<?php echo $row['nome'];?>" required >
</div>
</div>
</td>
<div class="form-group form-float col-lg-12">
<label><strong>Morada</strong></label>
<div class="form-line">
<textarea class="form-control" name="alterar_morada" id="alterar_morada" required ><?php echo $row['morada'];?></textarea>
<!--<label class="form-label">Data</label>-->
</div>
</div>
<div class="form-group form-float col-lg-12">
<label><strong>Telefone</strong></label>
<div class="form-line">
<input type="text" class="form-control" name="alterar_telefone" id="alterar_telefone" value="<?php echo $row['telefone'];?>" required >
<!--<label class="form-label">Data</label>-->
</div>
</div>
</td>
<div class="form-group form-float col-lg-12">
<label><strong>Email</strong></label>
<div class="form-line">
<input type="text" class="form-control" name="alterar_email" id="alterar_email" value="<?php echo $row['email'];?>" required >
<!--<label class="form-label">Data</label>-->
</div>
</div>
<div class="form-group form-float col-lg-12">
<label><strong>Contribuinte</strong></label>
<div class="form-line">
<input type="text" class="form-control" name="alterar_contribuinte" id="alterar_contribuinte" value="<?php echo $row['contribuinte'];?>" required >
<!--<label class="form-label">Data</label>-->
</div>
</div>
<div class="form-group form-float col-lg-12">
<label><strong>Horas</strong></label>
<div class="form-line">
<input type="time" class="form-control" name="alterar_horas" id="alterar_horas" value="<?php echo $row['horas'];?>" required >
<!--<label class="form-label">Data</label>-->
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default waves-effect " data-dismiss="modal">Fechar</button>
<button type="submit" class="btn btn-primary waves-effect waves-light" id="btn_inserir">Alterar</button>
</div>
</form>
Table button code
<td style="vertical-align: middle;">
<div>
<a id="btn_editar?<?php echo $row['cliente_id']; ?>" href="#div_editar" class="btn btn-info btn-xs waves-effect" data-toggle="modal" data-target="#large-Modal1">
<i class="fa fa-lg fa-edit"></i><!--edit-->
</a>
<a href="#" onclick="if (confirm('Tem a certeza que deseja eliminar este Cliente?')) window.location='iframes/clientes_apagar.php?cliente_id=<?php echo $row['cliente_id']; ?>';return false" class="btn btn-danger btn-xs waves-effect">
<i class="fa fa-lg fa-trash"></i><!--delete-->
</a>
</div>
</td>