I've created this JavaScript/AJAX code, but unfortunately, it's not functioning as expected and I am unable to determine the reason behind it.
$(document).ready( function(){
$('#btn4').click( function(){
var plano = $('#plano').val();
var plano = $('#name').val();
var plano = $('#age').val();
var plano = $('#identify').val();
var plano = $('#phone').val();
var plano = $('#email').val();
var plano = $('#password').val();
var plano = $('#endereco').val();
var plano = $('#cidade').val();
var plano = $('#cep').val();
var plano = $('#estado').val();
var plano = $('#code').val();
var urlData = "plano=" + plano + "&name=" + name + "&age=" + age + "&identify=" + identify + "&phone=" + phone + "&email=" + email + "&password=" + password + "&endereco=" + endereco + "&cidade=" + cidade + "&cep=" + cep + "&estado=" + estado + "&code=" + code;
$.ajax({
type: "POST",
url: "checkout2.php",
async: true,
data: urlData,
context: jQuery('#step3'),
success: function(data) {
$('#step2').hide('fast');
this.append(data);
$('html,body').scrollTop(0);
}
});
});
});
Could someone please provide assistance? Are there any syntax errors in my code that need to be addressed?