I am just messing around with some php and jquery. My test site has the user enter in numbers in a form and then when they click submit the information is sent to that php file, does some calculations and then prints the result in a <div> that I specify without reloading the page. I just want to know is there any way to retrieve that value that the php file returns in a jquery variable?
CODE:
$(document).ready(function(){
$("#results").hide();
$("#myform").validate({
debug: false,
rules: {
},
messages: {
},
submitHandler: function(form) {
// do other stuff for a valid form
$.post('process.php', $("#myform").serialize(), function(data) {
$('#results').show();
$('#results').html(data) ;
});
}
});
$.ajax()?