$('#Search').ajaxForm({ url: "../php/getArticle.php", // path to your script dataType: 'json', //This makes sure the data is handled as JSON success: showResponse //Call the function below if succeeded }) ; function showResponse(data) { $('#first').val(data.First); //add the first value of the JSON data to the first element $('#second').val(data.Second); [...]