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.
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 |
Sorry about that Tony.
no way to hijack submit buttons?
I think you would basically need to re-do the form block into a ajax form.
but i don't know much about ajax.
but i don't know much about ajax.
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.
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.
$('#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.
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.
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.
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.