Hi all, I've got a form which I need to post the information to an external site, but for some reason I'm getting an error:
Error: [Exception... "Access to restricted URI denied" code: "1012" nsresult: "0x805303f4 (NS_ERROR_DOM_BAD_URI)" location: "jquery.core.1-3-2.min.js Line: 19"] Source File: jquery.core.1-3-2.min.js Line: 19
Here's the code that I'm using to do the form (or attempt to do so):
<script type="text/javascript" language="javascript">
$(function() {
$(".FormButtons").click(function() {
var name = $("input#contactDataFirstName").val();
var lname = $("input#contactLastName").val();
var gender = $("input#contactDataGender").val();
var dobd = $("input#contactDataDateOfBirthday").val();
var dobm = $("input#contactDataDateOfBirthmonth").val();
var doby = $("input#contactDataDateOfBirthyear").val();
var mobile = $("input#contactDataMobilePhoneNumber").val();
var street = $("input#contactDataStreetAddress").val();
var suburb = $("input#contactDataSuburbTownCity").val();
var postcode = $("input#contactDataPostcode").val();
var country = $("input#contactDataCountry").val();
var state = $("input#contactDataCountrySubdivisionIDNew").val();
var password = $("input#contactDataPassword").val();
var email = $("input#contactDataEmail").val();
var remail = $("input#contactDataReceiveEmail").val();
var rmail = $("input#contactDataReceiveMail").val();
var rsms = $("input#contactDataReceiveSMS").val();
var dataString = 'contactDataFirstName='+ name + '&contactLastName=' + lname + '&contactDataGender=' + gender + '&contactDataDateOfBirthday=' + dobd + '&contactDataDateOfBirthmonth=' + dobm + '&contactDataDateOfBirthyear=' + doby + '&contactDataMobilePhoneNumber=' + mobile + '&contactDataStreetAddress=' + street + '&contactDataSuburbTownCity=' + suburb + '&contactDataPostcode=' + postcode + '&contactDataCountry=' + country + '&contactDataCountrySubdivisionIDNew=' + state + '&contactDataPassword=' + password + '&contactDataEmail=' + email + '&contactDataReceiveEmail=' + remail + '&contactDataReceiveMail=' + rmail + '&contactDataReceiveSMS=' + rsms;
$.ajax({
type: "POST",
url: "path_to_url",
//dataType: "jsonp",
data: dataString,
success: function() {
$('#contact_form').html("<div id=\"message\"></div>");
$('#message').html("<h2>Contact Form Submitted!</h2>")
.append("<p>We will be in touch soon.</p>")
.hide()
/*.fadeIn(1500, function() {
$('#message').append("<img id='checkmark' src='images/check.png' />");
});*/
}
});
return false;
});
});
</script>
Could someone please help me post my data to the external website :)