I can only modify the code in the ajax call. The ajax call occurs when I click the submit in form named $(\'#form1\').
$(\'#form1\')
$(\'#form1\').submit(func
You need to prevent form submitting
onclick="ajaxcall(); return false;"
And do it in your code:
$.ajax({ url:'some.php', type:'POST', data:somedata, success:function(msg){if(msg) $('#form1').submit();} })