Pass ID by parameter in modal window

0

I was wondering how can I pass a user's ID parameter to a modal window using php . I'm using bootstrap to use its modal.

In this window would open a form with information of the client, to be able to be changed and saved again.

                         × Close           New customer         

    <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>

    
asked by anonymous 19.07.2014 / 02:51

1 answer

2

A simple example

$.ajax({
  url: "cliente.php?id=123",
}).done(function( content ) {
  // LOAD MODAL( content )!!!
});


client.php
use $ _GET ["id"] to query user data and return information

    
19.07.2014 / 06:55