• 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: Conditional fields animated

Conditional fields animated 6 years 1 week ago #39060

  • mylo
  • mylo's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 13
  • Thank you received: 3
I hate that conditional fields just pop open when they are triggered and always wanted to do something that wasn't so abrupt. I had actually accomplished this a while ago, but failed to document it and had to revisit it recently due to the javascript rewrite that was done on the newest version of RSForm.

First of all, this should be done using an override. If you try to modify the core code, it will be overwritten on the next update and it's never fun to repeat something that has already been done. If you are unfamiliar with overrides in Joomla, [url=http://https://www.rsjoomla.com/support/documentation/rsform-pro/customizing-rsform-pro/how-to-override-frontcss-file-in-rsformpro.html]RSJoomla has an article about it[/url] or you can Google it.

You are going to need the file: /media/com_rsform/js/script.js
Copy it to /templates/{your_template_name}/js/com_rsform/script.js

Open it to line 1565 where you will see a function called "setDisplay" with the following code...
setDisplay: function (items, value) {
		for (var i = 0; i < items.length; i++) {
			if (!RSFormPro.usePositioning) {
				items[i].style.display = value;
			} else {
				value === 'none' ? RSFormProUtils.addClass(items[i], 'formHidden') : RSFormProUtils.removeClass(items[i], 'formHidden');
			}
		}
	},

Replace that code with the following...
setDisplay: function (items, value) {
		for (var i = 0; i < items.length; i++) {
			if (value === 'none') {
                    		jQuery(items[i]).slideUp( "slow" );
                	} else {
                    		jQuery(items[i]).slideDown( "slow" );
                	}
		}
	},

If there's a problem with using this, someone more educated than I can comment. I'm just trying to contribute to open source.
The administrator has disabled public write access.
The following user(s) said Thank You: ph6
  • 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!