• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Reset all error messages

Reset all error messages 7 years 5 months ago #37538

  • master5
  • master5's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
Do you want all error messages to be reset when the user clicks the Reset button? Then you can use this JQuery script.

The script is placed in the form's Javascript area.
It removes the class "error" in all "rsform-block" div, hiding all error messages by resetting the class for the "formValidation" span from "formError" to "formNoError", and removing the forem's main error message and even the Google reCaptca v2 error message.
<script type="text/javascript">
	jQuery(document).ready(function(){
		jQuery("button[type=reset]").on('click', function(){
			// Remove the error class from the form block
			jQuery(".rsform-block").removeClass('error');
			// Reset/hide the form validation message
			jQuery(".formValidation span").removeClass('formError').addClass('formNoError');
			// Remove the over all form error message
			// NOTE! You must specify at least one of the Form Attributes "CSS ID" or "CSS Class"
			// Use one of these instead of  "your-form-id/class" - don't forget the"#" or "."
			jQuery("your-form-id/class").find('p').first().remove();
			// Remove the reCaptcha v2 message. The element ID may vary depending on template
			jQuery("#system-message-container").html('');
		});
	});
</script>
Regards
Tage
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!