• 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: Why is JS added when ajax validation is off?

Why is JS added when ajax validation is off? 12 years 2 months ago #21660

  • jacob2
  • jacob2's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 2
This inline script is added after every form by helper.php, regardless of $form->AjaxValidation causing an error on my site:-

Uncaught ReferenceError: ajaxExtraValidationScript is not defined

because I have removed RSforms javascript that was added to every page.
<script type="text/javascript">ajaxExtraValidationScript[3] = function(task, formId, data) {var formComponents = {};formComponents[23]='Name';formComponents[24]='Email';formComponents[25]='Message';if (task == 'afterSend') {
		var ids = data.response[0].split(',');
		for (var i=0; i<ids.length; i++) {
			var id = parseInt(ids[i]);
			if (!isNaN(id) && typeof formComponents[id] != 'undefined') {
				var formComponent = rsfp_getFieldsByName(formId, formComponents[id]);
				if (formComponent && formComponent.length > 0) {
					for (var j=0; j<formComponent.length; j++) {
						formComponent[j].className = formComponent[j].className.replace(' rsform-error', '');
					}
				}
			}
		}
		var ids = data.response[1].split(',');
		for (var i=0; i<ids.length; i++) {
			var id = parseInt(ids[i]);
			if (!isNaN(id) && typeof formComponents[id] != 'undefined') {
				var formComponent = rsfp_getFieldsByName(formId, formComponents[id]);
				if (formComponent && formComponent.length > 0) {
					for (var j=0; j<formComponent.length; j++) {
						formComponent[j].className = formComponent[j].className.replace(' rsform-error', '') + ' rsform-error';
					}
				}
			}
		}
		}
}</script>
Last Edit: 12 years 2 months ago by jacob2.
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!