2
should be placed the inputs
, etc within a <form id="algo" method="POST"></form>
?
<form id="algo" method="POST">
<input type="text" value="NADA" name="valor1" />
<input type="text" value="TUDO" name="valor2" />
</form>
Or I can send via ajax like this:
<input type="text" value="NADA" name="valor1" />
<input type="text" value="TUDO" name="valor2" />
The ajax:
$.ajax({
url: "algumaurl.php",
type: "POST",
data: {
valor1: $("[name='valor1']").val(),
valor2: $("[name='valor2']").val(),
},
success: function(data){
//faz algo
}
});