我正在尝试通过 jQuery 和 AJAX 提交我的表单,但似乎最终采取了 self (index.php) 的操作,而不是 jQuery 提交处理程序。任何想法为什么?
<form id="artist_signup" action="index.php" method="get" oninput="AoutName.value=ANAME.value">
<input type="hidden" name="ajax" value="true" />
<div class="inlineInput">
<input type="text" name="ANAME" placeholder="Name">
</div>
<div class="inlineInput">
<input type="text" name="LOCATION" placeholder="City, State">
</div>
<div class="inlineInput">
<input type="email" name="EMAIL" placeholder="Email">
</div>
<div class="inlineInput">
<input type="url" name="AWEBSITE" placeholder="www.myawesomeband.com">
</div>
<div class="submitContainer">
<input type="submit" value="Sen" class="donateButton formSubmit">
</div>
<div id="artist_message"></div>
</form>
<script type="text/javascript">
$(document).ready(function() {
$('#artist_signup').submit(function() {
$("#artist_message").html("<span class='error'>Adding your email address...</span>");
$.ajax({
url: 'inc/store-address.php',
data: $('#artist_signup').serialize(),
success: function(msg) {
$('#artist_message').html(msg);
}
});
return false;
});
});
</script>