AEM OOTB Form Component and AJAX Submission - ajax

I'm evaluating AEM 6.2 OOTB forms component to build a Newsletter signup form with AJAX submission, this is not AEM Forms that is licensed separately.
https://docs.adobe.com/docs/en/aem/6-2/develop/components/developing-forms.html
I have not used this component previously, can someone advise on the following:
Can I make the form submit request via AJAX and capture response from the server side / API (asynchronous)?
Is there limitation in terms of styling capability? I'm trying to achieve the same signup form at the bottom of this page https://westernstarbutter.com.au/en/recipes/ham_-cheese-and-veggie-bake.html
Any other limitations / gotchas that I should be aware of?
Would love to hear some advices on this, would be great if someone can share some implementations as well.
Thank you!

Can I make the form submit request via AJAX and capture response from the server side / API (asynchronous)?
I don't believe you can do this OOTB - it's certainly not part of the actions list but it wouldn't be too hard to create a custom action and add the necessary Javascript code to hook into the form submission.
Is there limitation in terms of styling capability?
Not really - just add your own CSS and off you go.
Any other limitations / gotchas that I should be aware of?
I remember the validation being very limiting, especially if validation of a field is dependent on another field.

Related

TYPO3 v8 Form framework submitting form with ajax

Is there a way to configure the TYPO3 core Form framework to submit a form with ajax?
I already tried to submit the whole form, but i think that the honeypot or another security feature prevent it from submitting directly.
Is there any simple solution to fix this?
Since this question ranks fairly high when searching for 'typo3 forms framework ajax', this link might help you with this task, finally:
https://www.comuno.net/blog/detail/formular-mit-typoscript-rendering-per-ajax-verschicken/

Usage of Ajax form

I am an average newbie to CakePHP. While reading cookbook found Ajax form and its submission. But it lacks more details.
What are the main difference between ajax form and a normal form or What are the more specific cases we need to use Ajax form over normal form?
An example will be appreciated
Thanks....
A properly implemented Ajax form is exactly the same as a regular form, except that if JavaScript is enabled a submit handler will be bound to it that will prevent the normal submission of the form and send the data using the XMLHttpRequest object. The response will then be processed by JavaScript in the current page instead of by loading an entirely new page.
This isn't necessarily a CakePHP question, it's understanding what AJAX is.
AJAX in layman's terms is basically submitting data to a website without reloading the current page. If this is the sort of feature you want, you'll need to look into the RequestHandler component and the JsHelper in the CakePHP book for the version you are using.

Unobtrusive Javascript Validation with MVC 3, is preventing me validating form manually

For 90% of my site the standard MVC annotation with client script method is working a treat. But I have a form on the site that is quite complicated with multiple instances of dynamic form content dependant on answers to questions etc.
If I have the unobtrusive script included on the page, it's capturing the form submit and not allowing my custom jquery validate to validate the form.
I don't really want to refactor the site to have a seperate layout to remove the script when it's not needed. I wondered if there was an easy way to give control back to my custom validate script.
Any help would be great.
In your view you can disable client side validation like this
Html.ViewContext.ClientValidationEnabled = false

Drupal 7 Ajax Forms

I am using Drupal 7, and I am building a web site, that has a contact form in the footer which should appear in every page. The requirements was to make this form work via Ajax, all examples I found on Internet was form that related to node.
So when I tried to apply the same concept, I faced the problem of rendering the form, so I have passed it to the template as a parameter like this:
$vars['node']->contactForm = drupal_get_form('nilecode_form');
When I render the form by using drupal_render_children($node->contactForm), all the fields were rendered but with no wrapping form tag.
So after frustration, and not very useful IRC chats, I am thinking to do it by using normal Ajax request.
Before doing so is there any solution, before doing it the bad way?
Thanks.
Take a look at my ajax form examples, the best way of achieving this is using a theme function for the form:
http://monchacos.com/monchacos/code/creating-forms-template-file-ajax-included
Theres an attachment in the post, so you can get the full code example.

Can I make simplemodal contact form post across domains?

I'm using the SMCF Wordpress plugin on this site: http://fingelly.com/
As you can see it uses ajax to post the form fields to get mailed and then updates the modal.
Some of the nav options at the site take you to a 3rd party IDX (real estate listings) provider. For example click on the tabs marked agents and the url changes to fingelly.idxre.com...
As you can see the html is customizable there... I had tried adding the same simple modal contact form to my template there but encountered a problem because I cannot post using ajax to my wordpress driven site from this other domain.
I understand this limitation is for security reasons to prevent xss. How would you suggest working around it in this case?
For now we've simply removed the contact tab.
If you just need to send information to the server and not worry about the response, you create a hidden iframe on the page and post the data there. You could also make a JSONP call if the data would fit in a GET.

Resources