In my application on a button onClick, I am loading a form in an overlay using ajax. But this for submission is not redirecting to the required page.
I have tried the same form element without ajax and overlay, then it is working fine. So there is no problem with the form element. I think I am missing some settings to invoke form submission inside ajax.
I am using Web2py application.
I would greatly appreciate any suggestions.
EDIT:
I have one more similar question. I am displaying a web2py SQLFORM for a db-table in an overlay using ajax. The form submission and data update is working fine. But after the form submit I want to close the overlay and reload the page. Right now, it is showing 'Server Error' inside the overlay. I am using LOAD() to load the form on overlay.
Related
I have used dompdf in my laravel application and I'm calling the pdf generate function from the same form submit button and both are working fine. The only issue I'm facing right now is on my generated pdf file every hard refresh/reload, form data is submitting again to the database. Is there any possible way that i can prevent that reload or form submit?
I tried with this below Jquery but that completly prevent my form by clicking the button also. I just want that form not to submit again on pdf file reload.
$("#orderForm").submit(function(e) {
e.preventDefault();
});
I have a small problem in my first spring&hibernate application.
In my page, I would like to create a popup window (modal) which gives the possibility to send an email. So, this popup would display a spring form with a fied "subject" and a field "content".
The question is : how can I use the form binding mechanism of spring with this popup form if I don't want my main page (displayed behind the popup form) to be reloaded?
If i am not wrong, the content of the popup is a div present in the main page. So, If I submit the form in the popup, the whole page will be reloaded (through the mvc mechanism of spring) and this is exactly what I don't want.
Of course, I can submit my form via an ajax call to a spring controller, but in this case, how to handle the eventual errors in the form? I cannot use the spring form binding mechanism to display the errors on the popupform. Is it possible?
Do you know if there is a way to open a new window in a modal popup? So that this page and only this page would be reloaded during the submission of the form?
Actually, I am not sure of the best way to combine a popup containing a form and the form submission mechanism of spring. How to display the errors on the form in case of errors? after reload of the page, If there are some errors, I need to open my popup again in javascript and then display the errors on the popup, this is the only mean I see, but maybe there are easier solutions.
If you have, I would be happy to know it.
thanks a lot
After looking around at some stuff, I've found that you can submit a form to a frame using the "target" attribute.
That works for me, except, it submits the WHOLE form.
I have a form. It's all submitted to a PHP file with AJAX POST.
I want to include an image upload in this form.
Is there any way to directly upload the image THROUGH AJAX to the same PHP file, or do I have to put a form within a form (because I think that that's rather sloppy).
Thanks a bunch!
NO jQuery. Straightforward DOM, please.
A bit of background: I am using asp .net MVC and I am not allowed to asynchrounously submit the form using JQuery. When the user submits the form it takes a few seconds for the save to happen and then a message is displayed to them. In this time the client wants to show an overlay with an image and a processing label. I was using BlockUI (Jquery plugin) for all overlays but it wont work since I am not posting the form via ajax.
Any ideas on how to show an overlay is much appreciated.
TIA.
Regards,
Raja
You can tie a overlay to the button click, because you are not using AJAX the form submission will reload the page.
Also, blockUI should not require AJAX.
$('.button').click(function() {
$.blockUI();
});
Since u are using MVC, am not sure if u are using webforms or controllers.
Please try this,
For webforms, u can use OnClientClick to call a javascript to show the div that has the processing gif image.
For controller pattern, in onclick event handler before the form is submitted, use javascript/jquery to show the div that has the processing gif image.
The project I'm working on is using the Java EditLive! rich text editor. I've been trying to make the EditLive form post via ajax, but am having some problems using IE8. Here are the steps we're taking:
Load the main page
The user clicks a link and the EditLive applet is loaded and attached to the page via ajax
The user finishing editing their document and clicks the submit button
The form posts via ajax (we're using jQuery.post())
The EditLive section is reloaded and the EditLive content is correct.
The form immediately posts again
The EditLive content is back to being blank.
Unfortunately (for debugging reasons), this is not happening in FireFox - there is only a single form post and the values are saved correctly.
From what I can tell debugging this in IE8, it looks like the submit event is getting called twice with 2 different forms. My thought is that the applet isn't getting destroyed correctly, though I've tried everything in my power to destroy it.
So I was wondering if anyone has any experience successfully submitting EditLive data via ajax? Or maybe this is just a limitation to the product?
Any help would be greatly appreciated!
I know this is an old issue but you likely want to look at the autoSubmit property of EL:
http://docs.ephox.com/display/EditLive7/AutoSubmit+Property
http://docs.ephox.com/display/EditLive/AutoSubmit+Property
I suspect that by using an AJAXy submit process this is somehow causing you issues with EditLive and its standard behavior. I would try turning off autoSubmit and grabbing the content yourself in your jQuery posting process.