简体   繁体   中英

open a new form in the same colorbox after pressing the submit button

i have a form with a submit button open in a colorbox and i want that after pressing submit a new form will show to the same colorbox. so i have the main page

<link media="screen" rel="stylesheet" href="colorbox.css" />
<script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript">
</script>
<script type="text/javascript">`
$(function()
{
$('#link_content').colorbox({opacity:0.3});
});
</script>

and the part where i open the ragister.jsp

<a  href='ragister.jsp' id='link_content' ><h2>Register here </h2></a>

the register.jsp has a form with the submit button that after pressing it calls a process.jsp where the process.jsp validate if the text box of the ragister.jsp are correct or not if they are they are saved in database if they are not the process.jsp include another form with the specific error (error.jsp)

so what i want is that the process.jsp and the error.jsp form to display in the same colorbox of the ragister.jsp

thanx!

For this to work you need to force colorbox load within iframe. As i recall all you need to add to .colorbox() is 'iframe': true but that also requires that you specify exact width and height because colorbox has no way to know what's happening in that iframe it creates.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM