Drupal 6 Ajax module: altering form after submission - ajax

I am using Ajax module in Drupal 6 to ajaxify my simple contact form. It works fine, the form is ajax-submitted and validation errors are displayed correctly, but I can't figure out a way to alter my form after successful submission. Namely, I want to remove most of my input fields and replace them with a "Thank you for your request" message. I assume this should be somehow achieved with hook_ajax_validate_pass, but I have no idea how to use it... Any help appreciated.

Related

What is the best way to place 2 forms on the same page?

What is the best way to place 2 identical forms on the same page, but use the same form action and fields for each form? How can I keep response messages in the respective form area from which the data was submitted?
I'd have one form in the footer of my site, and one form in a popup on the home page of my site. I'm using a hidden div and Magnific to open the popup containing the same code from the form that is located at the footer. Essentially, both form do the same thing, and utilize the same form action.
I do not have access to the form action, or the code in the form action page.
Currently, the forms existing on the same "page" are no problem, but when I submit an email on one form, the errors and success messages show up on both the popup form as well as in the footer form.
I've read that this may be possible to do with ajax, but for completeness sake, I want to make sure that I'm building that I'm doing what I can with the form html, before moving on to studying ajax for this.
Sadly there is no nice html/liquid solution for this.
The only way is to use cookies in order to save information which form was submitted and show the error message only for that form instead of the two ones.
AJAX is not a good solution because of the Google Recaptch-a when you submit the form more than once, which is a real pain in the a** since there is no way to disable it and the form will fail if you try to submit it with ajax.
The easiest solution is to use cookies, other option is to rely on an APP for this, but it may be an overkill for this.
Forms in Shopify are... how to put it nicely... dumb... basic... not developer friendly or just not made to be tweaked in any sort of way ( excluding the front-end ).

Contactform7 not working

My contact7 form is not working, none of the functionality is working, tha ajax and after post validation aren't working. I checked the console for a conflict but there's none. The html is the same i've used on other forms.
This is my form:
disennio.com/clients/lunata/reservaciones/
Looks like you are trying to manually insert the form code on your page. Instead, you'll need to use Contact Form 7's insert a form feature while you are editing that particular page in the WordPress dashboard.
It was mobile plugin related issue, will find another solution for mobile validations. Sorry.

Invoking validation just after display the form JSF

I have a form where the user should be able to save even if there are validation errors.
These errors should be displayed once the user get into the form again.
So, i would like to invoke the validation of the entire form just after the form is displayed.
Currently, the validation is handled thru AJAX with several custom validators by using <f:validator/> and <p:ajax/> only when the user edits the field
Any suggestion is welcome!
Thanks!
An option would be to submit the form after it loads directly.
To achieve this you can use p:remoteCommand and something like jQuery('document').ready(function(){remoteCommandName()})

MVC 4, Jquery Mobile, Ajax.BeginForm causing forms to submit twice

Does anyone know of any bugs or other insight to explain why when using MVC4 with jquery mobile, any form that is created using Ajax.BeginForm results in the form being submitted twice to the controller.
I had originally thought that since I am using the js bundling that the same js file might have been being included twice and might be triggering on form submit, however thats not the case, my list of js files are:
jquery-1.6.4.js
jquery-ui.1.8.11.js
jquery.mobile-1.1.0.js
jquery.unobtrusive-ajax.js
jquery.validate.js
knockout-2.0.0.js
MicrosoftAjax.js
MicrosoftMvcAjax.js
MicrosoftMvcValidation.js
Modernizr.js
Within the project Ajax is fully enabled for everything i.e. i'm not disabling anything through mobileinit.
I have not posted any form code because it literally happens with every form - a form with one field and a submit button will cause the submission twice - but only where Ajax.BeginForm is being used.
Html.BeginForm doesn't exhibit any of these problems.
I've been stuck on this for a few days now so any help would be greatly appreciated
jQuery Mobile by default hi-jacks any form submission and performs its own AJAX request. To stop this behavior you can place the data-ajax="false" attribute on any <form> tag. Also make sure to stop the regular behavior of the form so it doesn't submit normally, something like:
$('#my-form').on('submit', false);
Docs: http://jquerymobile.com/demos/1.1.0/docs/forms/forms-sample.html
You could also just use the built-in jQuery Mobile AJAX rather than including extra JS for it. Which would only require you to make the action attributes of the forms to the server-side file to which they posts.

form validation using ajax/jquery in Joomla

I want to create custom form validation in joomla using ajax or jQuery. on-blur when user input a invalid thing it should validated and show the error and all error messages should read from xml. Please guide me.
use the class name to get control event in joomla instend of controlID with Jquery.
need any further help it then give me more info about your post.

Resources