I have a simple form that uses jquery and a servlet. The jquery makes an ajax call to the servlet, the servlet makes some server side calculations, then displays the result
$('#post_form_jason_data').click(function() {
$('#myform').validate({
rules: {
txtwtrt: {
required: true
// email: true
},
tax_name: {
required: true,
minlength: 5
},
tax_rate: {
required: true
//minlength: 5
}
}
});
alert('insert the value');
if (('#myform').valid()){
$.ajax({
url: "swt_tax_add.html",
type: 'POST',
data : $('#myform').serialize(),
success: function(msg) {
window.location.href='swt_tax/?st=1';
$('#message').html(msg);
}
});
}
return false;
});