开发者

Implementing a preview button for a form and keeping the form data after clicking the button

I have a form with a wysiwyg editor and I would like to add a 开发者_如何学Cpreview button so the user can see how the content would look like in the website.

In order to do this I inserted another submit button wich gets the info from the form and redirects to a preview page.

All ok, but after clicking that button the form content disappears so the user can see a preview but it has no data in the actual form in order to make some changes or to submit the form in order to save the data.

So here's my question: can I have this preview button and also keep the data in the form after clicking the preview button?


What you need is either:

  • Repopulate the form from the preview function (that means manually fill in the form with the submitted data)

OR

  • Use Ajax to submit the form to the preview function and keep open the current edition page.

By the way, you can't have two submit for one form.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜