jQuery is indeed functional (version 2.0.3) and an alert in the external js file put outside the submit event function pops up fine.
jQuery:
if (window.jQuery) {
// jQuery is loaded
alert("1");
} else {
// jQuery is not loaded
alert("2");
}
$( "#test" ).submit(function( event ) {
alert( "Handler for .submit() called." );
event.preventDefault();
});
Testing post, none of the php code runs:
$( "#test" ).submit(function( event ) {
event.preventDefault();
$.post( "addCal.php", $( "#test" ).serialize() {
alert( "Yooo" );
});
});
HTML:
<head> <script src="jQuery.js"></script> <script type="text/javascript" src="addCals.js"></script> </head> <form id="test" action=""> <input type="text" id="no" /> <input type=submit value=submit /> </form>
I've tried not listing an action and 'action="/"'. Doesn't make a difference. What am I doing wrong?
This post has been edited by Kiakime: 13 January 2014 - 04:41 AM

New Topic/Question
Reply


MultiQuote


|