I need to save the value of a input type text in a PHP variable as soon as the user writes it. I found that the blur event in JQuery can trigger an event that happens after writing to the input type text, so I have the following:
<script>
$("document").ready( function()
{
$("#primerApellido").blur(function() {
alert('out');
<?php
$primerApellidoForm =
"<script type=\'text/javascript\'>
$('#primerApellido').val();
</script>
";
?>
});
});
</script>
And here is my input type text:
<input type="text" id="primerApellido" name="primerApellido" value="<?php echo $primerApellidoForm?>"/>
So as you can see, I need to save what is typed on the input on the PHP variable as soon as the user leave the text box. Right now it save literally the Javascript variable assignation, not the value that I need.
How can I assing the typed value on the text box to my PHP variable?