user441365
user441365

Reputation: 4024

fancybox form submit

I have a form that submits some content to a database and it works fine.

Now I want to move it to a fancybox. The problem is that when I click the submit button on the fancybox the page redirects to the actual form page instead of staying on the fancybox.

Any idea on how to stop the page from redirecting?

Thanks

Upvotes: 1

Views: 8249

Answers (2)

demux
demux

Reputation: 4654

You could do an ajax post request.

See: http://jquery.malsup.com/form/

Upvotes: 0

Matt Asbury
Matt Asbury

Reputation: 5662

How are you loading the content into the fancybox? If you use the iframe method, it should remain within it.

See point 4 on this page to load data as an iframe http://fancybox.net/howto

EDIT

You need to put the form in a separate page and then load that page into the fancybox using the method specified. For example, if you created a new page called myform.asp which would contain your form and form. You would then create a link on your page to contain your fancybox which would call the myform.asp page in an iframe:

<a href="http://www.yourdomain.com/myform.asp" class="iframe">Fill Out Form</a>

Upvotes: 3

Related Questions