2
I am developing a web application and I am using AJAX and JSP I would like that when I register the client’s data send by parameter to another page the client’s name and email plus it sends with an error, it even sends the parameters but with these quotes ' ' '
HTML
<form >
<div class="container-fluid">
<div class="row">
<div class="col-sm-6 col-md-4">
Nome Completo:<input type="text" id="nome" name="nome"><br/><br/>
</div>
<div class="col-sm-6 col-md-4">
CEP:<input type="text" id="cep" name="cep"><button type="button" id="buscar_cep"><i class="fa fa-search" action="" ></i></button> <br/><br/>
</div>
<div class="col-sm-6 col-md-4">
Celular:<input type="text" id="nr_celular" name="celular"><br/><br/>
</div>
<div class="col-sm-6 col-md-4">
CPF:<input type="text" id="cpf" name="cpf" ><br/><br/>
</div>
<div class="col-sm-6 col-md-4">
UF:<input type="text" id="uf" name="uf" ><br/><br/>
</div>
<div class="col-sm-6 col-md-4">
Cidade:<input type="text" id="cidade" name="uf"><br/><br/>
</div>
</div>
<div class="row">
<div class="col-sm-6 col-md-4">
Rua:<input type="text" id="rua" name="endereco"><br/><br/>
</div>
<div class="col-sm-6 col-md-4">
RG:<input type="text" id="rg" name="endereco"><br/><br/>
</div>
<div class="col-sm-6 col-md-4">
Bairro:<input type="text" id="bairro" name="endereco"><br/><br/>
</div>
<div class="col-sm-6 col-md-4">
Telefone:<input type="text" id="telefone" name="telefone"><br/><br/>
</div>
<div class="col-sm-6 col-md-4">
Login:<input type="text" id="login" name="login"><br/><br/>
</div>
<div class="col-sm-6 col-md-4">
Senha:<input type="password" id="senha" name="senha"><br/><br/>
</div>
<div class="col-sm-6 col-md-4">
Confirmar Senha:<input type="password" id="confirma_senha" name="confirma_senha"><br/><br/>
</div>
<div class="col-sm-6 col-md-4">
Data de Nascimento:<input type="text" id="nascimento_dt" name="nascimento"><br/><br/>
</div>
<div class="col-sm-6 col-md-4">
Email:<input type="text" id="email" name="email" ><br/><br/>
</div>
<div class="col-sm-6 col-md-4">
Estado Civil: <label for="s1">Solteiro(a)</label>
<input type="radio" id="solt" name="status" value="solteiro"/>
<label for="s2">Casado(a)</label>
<input type="radio" id="estado_civil" name="status" value="casado"/><br/><br/>
</div>
<div class="col-sm-6 col-md-4">
Sexo: <label for="s4">Masculino</label>
<input type="radio" id="masc" name="sexo" value="masculino"/>
<label for="s6">Feminino</label>
<input type="radio" id="fem" name="sexo" value="feminino"/><br/><br/>
</div>
</div>
<button type="button" onclick="cadastrar()" >Cadastrar</button>
</div>
</form>
AJAX
<script type="text/javascript">
function cadastrar(){
$.ajax({
type: "POST",
url: "CadastroCliente",
data: {
nome: $("input[id=nome]").val(),
cep: $("input[id=cep]").val(),
celular: $("input[id=nr_celular]").val(),
cpf: $("input[id=cpf]").val(),
uf: $("input[id=uf]").val(),
cidade: $("input[id=cidade]").val(),
rua: $("input[id=rua]").val(),
rg: $("input[id=rg]").val(),
bairro: $("input[id=bairro]").val(),
telefone: $("input[id=telefone]").val(),
login: $("input[id=login]").val(),
senha: $("input[id=senha]").val(),
confirmar_senha: $("input[id=confirma_senha]").val(),
data_nascimento: $("input[id=nascimento_dt]").val(),
estado_civil: $("input[name='status']:checked").val(),
sexo: $("input[name='sexo']:checked").val(),
email: $("input[id=email]").val(),
},
success: function(result){
var email = $("input[id=email]").val();
var nome= $("input[id=nome]").val();
window.location.href = "ConfirmacaoCadastro.jsp?email="+email+"'"+" nome='"+nome+"'";
},
error:function(){
window.location.href = "erro.jsp";
},
});
}
</script>
Page error receiving parameters.
I could not identify which is the error on the page that receives the values. Can [Edit] the question and clarify better?
– Woss
in case it was to appear the parameters and not with these quotes
– User1999