I have a form in my site sending with post. I have to use the variables in the same page without reload the data. I have this.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html"; charset="ISO-8859-1">
<title>Ejemplo de carga de datos</title>
<script src="/Scripts/jquery-1.9.1.js"></script>
<script>
$(function(){
$("#form").submit(function(event){
var str = $(this).serialize();
alert(str);
<% System.out.println(request.getParameter("radioValue00")); %>
});
});
</script>
</head>
<body>
<h3>Ejemplo de captura de datos</h3>
<form name="form" id="form" method="post" enctype="multipart/form-data" >
Choose one:
<input type="radio" name="radioValue00" id ="radioValue00S" value="S" required> Yes
<input type="radio" name="radioValue00" id ="radioValue00N" value="N"> No
<input type="submit" name="submit" value="Enviar datos" />
</form>
</body>
</html>
<% System.out.println(request.getParameter("radioValue00")); %>
});
});
</script>
when I alert(str)
, I see the following:
I can see all the data, so it has been sent, but when try to print it is empty, how can I use it?