• 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: Hide joomla reg required fields conditionally

This message has been removed by user's request. 12 years 2 months ago #28456

  • 1b97f22fd527c09ff1a9b9ce57a0a9b8
  • 1b97f22fd527c09ff1a9b9ce57a0a9b8's Avatar
This message has been removed by user's request.
The administrator has disabled public write access.

Hide joomla reg required fields conditionally 12 years 2 months ago #28458

  • cosmin.cristea
  • cosmin.cristea's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 756
  • Thank you received: 144
You can approach your scenario in the following way. Grab the username/email using the method provided in the documentation :
http://www.rsjoomla.com/support/documentation/view-article/77-display-php-variables-by-default-when-form-is-shown.html

Next step would be to create a script that checks it's value so it can hide the unwanted fields.

Keep in mind this is an example and not a solution.

Insert this in the default value of the username field:
//<code>
$user = JFactory::getUser();
return $user->get('username')
//</code>

Head over to CSS and Javascript section and insert a code like the following (you will need jQuery):
<script>
jQuery( document ).ready(function() {
	if (jQuery("#name_of_username_field").val().length > 0){
		jQuery( ".class_of_the_username_field" ).hide();
	}
});
</script>

Next thing on the list is to stop the mapping from happening, in the scripts called after form process, insert the following code:
if ($user->get('id') > 0) {
	$mappings = array();
}
My help is not official customer support. To receive your support, submit a ticket by clicking here
Last Edit: 12 years 1 month ago by cosmin.cristea.
The administrator has disabled public write access.

Hide joomla reg required fields conditionally 9 years 3 months ago #37202

Hi,

I hope that somebody is still reading this post. I don't understand what to put instead of "jQuery( ".class_of_the_username_field" ).hide();"

The field I want to hide is named "Account" but there is no class. So what do I put instead of .class_of_the_username_field?

Thanks and regards,
Uwe
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!