Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.4k views
in Technique[技术] by (71.8m points)

jquery - Submit a form inside fancybox and redirect the page

I am using fancybox to display a form in my page, and when the form is submitted, i see that the next page is displayed inside the fancybox itself, instead of navigating to the concerned page.

I am invoking a fancybox like this:

<a href="login.php" id="fancybox_iframe" title="Please Login">
<img src="login.png"></a>

This is the jquery code:

$("#fancybox_iframe").fancybox({
  'width'            : '480px',
  'height'           : '575px',
  'autoScale'        : false,
  'transitionIn'     : 'none',
  'transitionOut'    : 'none',
  'type'             : 'iframe'
}); 

I am performing some validations when the submit button in the form is clicked, and when the validations are met, the form is submitting inside the fancybox itself... but i would like the fancybox to close and submit the page to the action url.

How can this be achieved ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Got a solution from this link

Just added target="_top" for the form tag and it worked well.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...