I got it now
$('form.ajaxForm').on('submit',function() {
$.ajax({
type: 'POST',
url: 'YOUR LOCAL HOST HERE OR BASE URL/maincontroller/testForAjax',
data:{ search: $("#searchInput").val(), searchType: $("#searchTypeID").val() },
dataType: 'JSON',
success: function(smg) {
}
});
});