I have a HTML Form with AJAX code
<html>
<head></head>
<script src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script>
function fChnage(){
var zipname = $('#zValue').val();
var emailname = $('#eValue').val();
$.ajax({
type: "POST",
url: "https://pub.s7.exacttarget.com/123",
data: { Zip: zipname,Email:emailname },
dataType: "html",
async: false,
});
});
</script>
<body>
<h2>Home insurance Form</h2><div>
<form action="https://pub.s7.exacttarget.com/123" id="myForm"method="post">
Zip Code:<br>
<input name="Zip" placeholder="Zip Code" type="text" id="zValue" onchange="fChnage()">
Email:<br>
<input name="Email" placeholder="Email address" type="text" id="eValue" onchange="fChnage()">
<input type="button" value="Buy" id="btnTest"> </form></div>
</body>
</html>
Processing Page
%%[
var @Zip,@Email
set @Zip = RequestParameter('Zip')
set @Email = RequestParameter('Email')
If Not Empty(@Email) Then
UpsertData('Updated_form_one_AJAX',1,'Email_address',@Email,'Zipcode',@Zip,)
EndIf
]%%
My current code is not working means its not posting any records to DE. Can i get any help on this?