0
I wanted to know how I can pass parameter o ID
from a user to a modal window using php
. I’m using the bootstrap
to use his modal.
In this window would open a form with customer information, so it can be changed and saved again.
Close-up New Client
<div class="modal-body">
<form class="formClient" action="includes/_cadCliente.php" method="post">
<div class="col-xs-4">
<div class="form-group">
<label for="nome">Nome*:</label>
<input type="text" class="form-control" id="nome" name="nome">
</div>
<div class="form-group">
<label for="email">E-mail*:</label>
<input type="text" class="form-control" id="email" name="email">
</div>
<div class="form-group">
<label for="Endereco">Endereço*:</label>
<input type="text" class="form-control" id="Endereco" name="endereco">
</div>
<div class="form-group">
<label for="Cidade">Cidade*:</label>
<input type="text" class="form-control" id="Cidade" name="cidade">
</div>
<div class="form-group">
<label class="checkbox-inline">
<input type="checkbox" name="campanhaEmail" id="inlineRadio2" value="sim"> Permitir campanhas de e-mail
</label>
</div>
</div>
<div class="col-xs-4">
<div class="form-group">
<label for="nomeCliente">Data de Aniversário*:</label>
<input type="text" class="form-control" id="nomeCliente" name="aniversario">
</div>
<div class="form-group">
<label for="nomeCliente">Celular:</label>
<input type="text" class="form-control" id="nomeCliente" name="celular">
</div>
<div class="form-group">
<label for="nomeCliente">Bairro:</label>
<input type="text" class="form-control" id="nomeCliente" name="bairro">
</div>
<div class="form-group">
<label for="estado">Estado:</label>
<select name="estado" id="estado" class="form-control">
<option value="">Selecione um estado</option>
<option value="ac">Acre</option>
<option value="al">Alagoas</option>
<option value="ap">Amapá</option>
<option value="am">Amazonas</option>
<option value="ba">Bahia</option>
<option value="ce">Ceará</option>
<option value="df">Distrito Federal</option>
<option value="es">Espirito Santo</option>
<option value="go">Goiás</option>
<option value="ma">Maranhão</option>
<option value="ms">Mato Grosso do Sul</option>
<option value="mt">Mato Grosso</option>
<option value="mg">Minas Gerais</option>
<option value="pa">Pará</option>
<option value="pb">Paraíba</option>
<option value="pr">Paraná</option>
<option value="pe">Pernambuco</option>
<option value="pi">Piauí</option>
<option value="rj">Rio de Janeiro</option>
<option value="rn">Rio Grande do Norte</option>
<option value="rs">Rio Grande do Sul</option>
<option value="ro">Rondônia</option>
<option value="rr">Roraima</option>
<option value="sc">Santa Catarina</option>
<option value="sp">São Paulo</option>
<option value="se">Sergipe</option>
<option value="to">Tocantins</option>
</select>
</div>
<div class="form-group">
<label class="checkbox-inline">
<input type="checkbox" name="campanhaSms" id="inlineRadio2" value="sim"> Permitir campanhas de sms
</label>
</div>
</div>
<div class="col-xs-4">
<div class="form-group">
<label for="nomeCliente">Sexo*:</label>
<select name="sexo" id="estado" class="form-control">
<option value="Masculino">Masculino</option>
<option value="Feminino">Feminino</option>
</select>
</div>
<div class="form-group">
<label for="Email">Telefone*:</label>
<input type="text" class="form-control" id="Email" name="telefone">
</div>
<div class="form-group">
<label for="Endereco">Como conheceu?</label>
<input type="text" class="form-control" id="Endereco" name="conheceu">
</div>
<div class="form-group">
<label for="Cidade">Observação</label>
<textarea class="form-control" rows="5" name="observacao"></textarea>
</div>
</div>
<div class="bar-button">
<button class="btn btn-default" data-dismiss="modal">Cancelar</button>
<button type="submit" class="btn btn-success">Salvar</button>
</div>
</form>
</div>
</div>
show the code you are using
– CIRCLE
What exactly? From modal? Is that I’m using bootstrap to call the modal....
– Altemberg Andrade
yes, the modal with the form you mentioned
– CIRCLE
Okay, only HTML does it? I didn’t put JS because I don’t know exactly which part to put...
– Altemberg Andrade
This modal is to load user information dynamically with AJAX or load the information directly into the page load?
– CIRCLE
It is a customer list and will have a button to edit the information, once the button is clicked, this modal is opened with the information of that customer, which will be selected by his ID.
– Altemberg Andrade
tested my answer?
– Papa Charlie