I am facing an issue where the console.log(data) statement is printing null on the console. I am trying to send the form data (with id "myform") to a Java backend post method, but for some reason the code is not functioning correctly. Can anyone identify what the error might be?
var myform = document.getElementById("myform");
var data = new FormData();
console.log(data);
jQuery.ajax({
url: '/WeatherApi/UserDetailsController',
data: data,
cache: false,
contentType: false,
processData: false,
method:'POST',
success: function(data){
alert(data);
}
});