Is it possible using jQuery, or any other language, to make an input's value a php variable without saving or refreshing the page?
I am trying to build a simple math form that has one constant and one variable. I need the calculated value to be displayed similar to the Live Preview with jQuery script.
<input type="text" name="word" value="<?php $second_number ?>" />
<?php
$first_number = 10;
$sum_total = $first_number + $second_number;
print ($sum_total); ?>
Live Preview with jQuery snippet, for reference:
<script type="text/javascript">
$(function()
{
$(".word").keyup(function()
{
var word=$(this).val();
$(".word_preview").html(word);
return false;
});
});
</script>