I'm testing some beginners features here and am having some difficulties on checking the $_POST content.
What am I missing here?
<html>
<body>
<form action="post.php" method="post" >
First Number: <input type="text" id="n1" name="n1"> <br> Second Number: <input type="text" id="n2" name="n2" onblur="calcular()"/> <br>
<input type="text" id="resultado" name="resultado">
<input type="submit">
</form>
<script type="text/javascript">
function calcular() {
var n1 = parseInt(document.getElementById('n1').value, 10);
var n2 = parseInt(document.getElementById('n2').value, 10);
var result = n1 + n2;
document.getElementById('resultado').value = result;
}
</script>
</body>
</html>
This is post.php:
<?php
echo "<pre>";
var_dump($_POST);
echo "</pre>";
?>