I think your problem might be that you are leaving the action property in the form element blank.
Sometimes this can cause unexpected results, like going to your default page (ie: index.html or index.php)
HTML Code:
<form id="form1" name="form1" method="post" action="">
Try filling in the action property value with an "#" sign.
HTML Code:
<form id="form1" name="form1" method="post" action="#">
Or like this:
PHP Code:
<form id="form1" name="form1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">