Forums

Ajax Submit and confirmation

leeburstroghm 09 Oct, 2011
Well, after skimming through 10 pages of ajax related search results, I decide to come right out and ask.

Does chrono allow for ajax submission of the form data, and then display of the confirmation?

I did find http://greyhead.net/chronoforms/show-a-form-in-a-light-box THANKS GreyHEAD!

This appears to work like an Iframe. External content loading into a lightbox. I have a very similar circumstance, but it is not a light box.

Is this lightbox method the only way to get the form to submit and return a confirmation without leaving the page, or is there an ajax submission action/method I am missing somewhere??

Thanks for any input on the matter!
GreyHead 09 Oct, 2011
Hi leeburstroghm,

I've never created an Ajax submitted form and I'm not certain if it can be done with ChronoForms. The mechanics are all there and technically it's possible, my hesitation is whether it would pass the security checks. At least one of these uses a token in the session and I suspect that the session might not be accesibls to an Ajax submission.

I suggest that you try it out. A test with a very simple form will tell you the answer. You need to create a new Event (use the Add Event button below the On Submit event). Call it ajax and add event=ajax into the Ajax URL you Submit to. You can then drag some test actions into your new event and see if they are executed. You may need to add a Custom Code action to put the form data into the $form->data array so that it is accessible.

Please let us know what you find.

Bob
leeburstroghm 09 Oct, 2011
well. time is of the essence, so I dont have time to try it. I will just hard code the form, I guess and use jquery to post the form data to a php script I will right.. I suppose that is the only wat to accomplish this..

Bummer deal man..
I will try a quick test but..
I have been trying this little test and things are just not clear enough and things are not working. I am not fluent with CF 4.0 yet so alot of the process eludes me still.

I see the httprequest action. is this what you are referring to?
GreyHead 10 Oct, 2011
Hi leeburstroghm,

Not the HTTP Request action in particular. I'd need to experiment to see what can practically be used there to bypass the security checks.

Bob
leeburstroghm 10 Oct, 2011
Well, I went ahead and used the iframe approach.
It took some extra jquery to get elements into and out of the iframe. but I got it.

Iframe in a light box, did pretty well, so that method solved my particular situation
dezignas 05 Jan, 2012
would be super fantastic if you would share you form🙂
This topic is locked and no more replies can be posted.