It seems like I'm overlooking a simple aspect... Here is a basic form that I want to submit to a PHP script. It works perfectly on PC and Mac, but it doesn't function properly in Safari on iPad, iPhone, etc. Do you think there's some mobile element that I might be missing?
<html>
<head>
<title>Title</title>
<script src="http://code.jquery.com/mobile/1.0a2/jquery.mobile-1.0a2.min.js"></script>
<script type="text/javascript">
$('form').submit(function(){
var postData = $(this).serialize();
$.ajax({
type: 'POST',
data: postData,
url: "http://www.norwichandyork.com/pocketleads/utilities/accounts.php",
success: function(data){
console.log(data);
alert('Your comment was successfully added');
},
error: function(){
console.log(data);
alert('There was an error adding your comment');
}
});
return false;
});
</script>
</head>
<body>
<form method="post" action="http://www.norwichandyork.com/pocketleads/utilities/accounts.php">
<label for="email">
<b>Email</b>
<input type="text" id="email" name="email">
</label>
<label for="fname">
<b>fname</b>
<input type="text" id="fname" name="fname">
</label>
<input type="submit" value="Save">
</form>
</body>
</html>
I've provided my full code again with the action URL included for easy testing. Thank you in advance for any assistance you can provide. :)