html - How can I define a jquery var to a php variable? -
i have simple question i've been looking , workin on awhile , can't seem it. heres code.
<script> function calculate() { var total = (parseint($('#studenttut option:selected').val()) + parseint($('#campusrb>option:selected').val())) * parseint($('#yearsatten>option:selected').val()); $("#total").html("<table width='100%'><tr><td>your calculated cost is: $" + total +"</td>" + "<td align='right'>" + "<?php $calculatedcost = " + total + ";" + " ?>"); } </script>
any suggestion on how can define jquery var php variable?
you cannot set jquery variable php .. since php server side code , javascript client side.... can use ajax send var server side.. or use form post var server... can use val()
place value form..
$('#inputid').val(total);
and post form
Comments
Post a Comment