I am a beginner in coding and facing some challenges in troubleshooting an issue.
My goal is to allow my API to accept multiple data inputs provided by the user through textarea. However, I have encountered a problem where everything works fine when only one input is given. When attempting to include code that would process input from a second textarea, all of the code stops functioning properly, including the GET request. I am looking for a solution that involves stringifying the data and extracting values from either a text area or input box.
Below is the code snippet for the POST ajax request:
$.ajax({
type: 'POST',
url: API_URL,
data: JSON.stringify({"message": $('#msg').val()}, {"password": $('#pass').val()}),
contentType: "application/json",
success: function(data){
location.reload();
}
});