Pop-up With Form

Permalink Browser Info Environment
Tony,

I'm using your pop-up block with the form block. Basically I'm using css classes to call it up.

Is there a way to keep the form contained in the pop-up even when its submitted?

It seems to jump to the actual page when its submitted or when it throws a required field error. I'd like to keep these errors and thank you messages in the pop up.

Let me know.

Type: Discussion
Status: New
bryanlewis
View Replies:
Tony replied on at Permalink Reply
Tony
the pop-up block can't automatically make block interfaces have ajax style submissions, but it does have an IFRAME option. You can turn that on, and then make a new "popup" page type that doesn't have any navigation (just and area on a blank page), adding the full to that new page type Then set up the popup rule so that you load the Full Page instead of just one target area.

btw, can you please use the Support forum instead of the Questions & Discussions forum for help configuring the package. it helps in managing all the open and closed requests.
bryanlewis replied on at Permalink Reply
bryanlewis
Sorry about that Tony.
synlag replied on at Permalink Reply
synlag
no way to hijack submit buttons?
bryanlewis replied on at Permalink Reply
bryanlewis
I think you would basically need to re-do the form block into a ajax form.

but i don't know much about ajax.
Tony replied on at Permalink Reply
Tony
yes, you can write some ajax to intercept that form submission, but for the popup, there's no intelligent way for it to know which forms to intercept, or which ones already have ajax attached to them. So for now, the best bet is to do this by hand. Add an on submit event to the form, serialize the form, and submit, then replace the contents. Ultimately it's going to behavior very much like the iframe mode though, so I don't really see what you gain from doing all this.
Tony replied on at Permalink Reply
Tony
here's some example code (not tested)


$('#myFormName').submit(function(){
var data = $('#myFormName').serialize();

$.ajax({
url: $('#myFormName').get(0).action,
data:data,
type:"POST",
success: function(response) {
//swap response into popup here
}
});
});

Not that you'll have to fire this after the popup loads the content, but the popup class should throw an event that you can intercept for doing this kind of thing.
synlag replied on at Permalink Reply
synlag
thx.
i'm using the jquery.form.js that already comes with c5, but still figuring out how to force the current popup to reload the current url on form submission, so the area which is selected for the popup reloads.
guess i need to fire loadURL again, but it does not work how expected.

concrete5 Environment Information

Browser User-Agent String

Hide Post Content

This will replace the post content with the message: "Content has been removed by an Administrator"

Hide Content

Request Refund

You have not specified a license for this support ticket. You must have a valid license assigned to a support ticket to request a refund.