<form method="post" action="load_statements.php?action=load" id="loadForm"
enctype="multipart/form-data">
that is my form, which looks fine to me. in that form, i put this button:
<input type="button" name="submit" id="submit" value="Submit" onclick="confirmSubmit()" class="smallGreenButton" />
here is the function it calls:
function confirmSubmit() {
// get the number of statements that are matched
$.post(
"load_statements.php?action=checkForReplace",
{
statementType : $("#statementType").val(),
year : $("#year").val()
},
function(data) {
if(data['alreadyExists']) {
if( confirm("Statements already exist for " + $("#statementType").html() + " " + $("#year").val() +
". Are you sure you want to load more statements with these settings? (Note: All duplicate files will be replaced)"
)) {
$("#loadForm").submit();
}
} else {
$("#loadForm").submit();
}
}, "json"
);
}
and as you can see, it calls $("#loadForm").submit();
, but the form is not submitting (ie. the page is not refreshing). why is that?
thanks!