Ajax is not working on first click on submit in contact form 7 - ajax

I have a form created in contact form 7. But Ajax submission is not working on the first click of submit. On first click it leads to URL like https://example.com/resolution-table-reservation-management-system/#wpcf7-f651-o1 and when click second time on submit the ajax works. I have checked that my header and footer have wp_head() and wp_footer(); functions. and also checked after deactivating all the other plugins. But still ajax is not working. Is there any solution to this? Please help. I don't know how to solve this.

Related

How to submit a form in a new page with using ruby web-watir phantomjs

I am using web-watir to drive phantomjs. I am trying to submit a bunch of forms(POST) on the webpage. I have all the forms in a collection. When I click the submit button and browser.back(), I get Selenium::WebDriver::Error::StaleElementReferenceError. I tried using form.submit() but same issue of going back and getting StaleElementReferenceError. I tried to submit the form in another page (browser.execute_script( "window.open(page)" )) but I don't think that will submit my form (if the form was a GET, that might have worked). I tried Net::HTTP.post_form() which is separate from the phantomjs session (did not work, I need to be logged in).
I am out of ideas except find the elements all over each time I navigate back. I guess I could replace phantomjs with Chrome or Firefox. Tell me, is there a way to submit the form in a new page phantomJS?
Here is some code:
forms = browser.forms()
forms.each{ | form |
form.submit()
browser.back()
}
If submitting each form brings you to another page, then it is expected that you get a StaleElementReferenceError for any previously saved elements. This is how Selenium-WebDriver was designed, so the problem will still exist if you switch to Chrome or Firefox.
Given that you are iterating through each form, it would be easy to locate each form by index:
browser.forms.length.times do |i|
browser.form(index: i).submit
browser.back
end
The above code took the same approach of directly submitting the form. However, if possible, the submit button should be clicked. Directly submitting the form may bypass important code that is tied to the action of clicking the submit button.

Contact Form 7 unable to submit by AJAX so redirects to 404

I am working on a build for a new website which includes the Wordpress plugin Contact Form 7 to handle the submission of the form & (is supposed) to display a response via AJAX.
I simply cannot get the AJAX side of this to work. Upon submission the form works fine, but the page reloads and displays the 404 page... not cool!
Following the FAQ page I have run a number of tests. I can confirm:
The page is correctly referencing wp_head and wp_footer.
The page has no JavaScript errors in the console.
Whilst the page has one or two validation errors (created by another plugin), I don't believe this to be the issue. I have attempted to test this by stripping out everything except the form (and the header & footer).
I have deactivated each plug-in for conflicts & the problem persists.
I have flushed the permalinks (by re-saving via settings > permalinks) & tested.
I have created new form instances & tested.
Reinstalled the Contact Form 7 plug-in & tested.
After all that I'm still no closer to a solution. Can anyone shed any light on this issue as I'm very keen to avoid using an alternative plugin.
I can provide more details if needed. Thanks!
I tried clicking on the URL you provided for your website and it did not work.
I would check to ensure there are no conflicts with the jQuery as this could be the cause of the form not submitting with AJAX.

Form submission inside ajax

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.

MVC3 using BeginForm on IE9 Needs to submit twice before contoller gets called

I have a form that uses Html.BeginForm and for most cases this works as you would expect.
But in some situations I display a partialview that does several ajax calls to populate itself. When the partial view has been displayed I need to click the submit button twice to get the form to post. On the first click I can see the form refresh, and then on the second click the form actually posts. This is when using IE9, using Firefox the posts work on the first click.
I would like to know if anyone has seen this behaivor before I spend a lot of time trying figure this out.
Install Fiddler, open it up, and then reproduce the issue in IE. Fiddler will capture all of the requests, so you can see exactly what was sent to the server (and back).
Had a similar issue. The reason was, we had a in view and in addition we were doing $('#form').submit() as well. But the button didn't have "type" attribute. After setting button type=button. It was good.

EditLive! Rich Text Editor - submitting form via ajax

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.

Resources