Просто, чтобы привести конкретный пример работы
<form id="loginForm" target="myFrame" action="https://localhost/j_spring_security_check" method="POST">
<input type="text" name="j_username" value="login" />
<input type="text" name="j_password" value="password" />
<input type="submit">
</form>
<iframe name="myFrame" src="#">
Your browser does not support inline frames.
</iframe>
// Hide the form and do the submit
<script>
$(document).ready(function(){
var loginform= document.getElementById("loginForm");
loginform.style.display = "none";
loginform.submit();
});
</script>