• 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: Working with disabled dropdown options

Working with disabled dropdown options 12 years 2 months ago #16202

  • wirecreative
  • wirecreative's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 21
  • Thank you received: 2
I understand that you can functionally create a disabled dropdown option by merely leaving the value blank, like this:

|Select an option

However, that is not the same as a truly disabled option, which should display differently from the active items in the list (often greyed out and sometimes italicized). Is there any way to mark one or more items in the option list as truly "disabled"?

Thanks,
Greg
The administrator has disabled public write access.

Re: Working with disabled dropdown options 12 years 2 months ago #16229

  • andreic
  • andreic's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 722
  • Thank you received: 59
Hello,

This can be achieved with some custom scripting. Please try adding the following script in the "CSS and Javascript" tab:
function disDD()
{
 
    item = document.getElementById('dropdown_name');
	limit = item.options.length;
 
   for(i = 0;  i< limit; i++)
   {
		if(item.options[i].value == 'desired_value')
			item.options[i].disabled = true;
   }
 
}

You can trigger the function when the page is loaded with:
window.addEvent('domready', function() {
disDD();
});
Please note: my help is not official customer support. To receive your support, submit a ticket by clicking here
Regards,
RSJoomla! Development Team
The administrator has disabled public write access.

Re: Working with disabled dropdown options 12 years 2 months ago #16249

  • wirecreative
  • wirecreative's Avatar
  • OFFLINE
  • Junior Boarder
  • Posts: 21
  • Thank you received: 2
Perfect, thanks!
The administrator has disabled public write access.

Re: Working with disabled dropdown options 7 years 10 months ago #35168

hello...

can i use this option to new version´s rsforms?

Luciano Sales
The administrator has disabled public write access.

Working with disabled dropdown options 7 years 10 months ago #35174

  • adrianp
  • adrianp's Avatar
  • OFFLINE
  • RSJoomla! Official Staff
  • Posts: 631
  • Thank you received: 146
Hello,

Dropdown options can be disabled using the [d] syntax while specifying items, for example:

Cat
Parrot[d]
Dog

If however you need a dynamic approach on this, you can try a similar method through JavaScript as presented above.
This is not official customer support. To receive your support, submit a support ticket here.
The administrator has disabled public write access.

Re: Working with disabled dropdown options 4 years 8 months ago #39366

  • holym
  • holym's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 1
Hi,

trying to edit this custom script from Andreic. It works well with dropdown but I want it to work with radio buttons group. I use values submitted from dropdown list from different form. Only matching values from the first form should be visible in a new form as a radio buttons group values. Rest of the values should be either greyed out or not visible.
Example:
first form - dropdown values
1
2
3
I choose values 1 and 2

second form
in a radio buttons group field are visible only these two values submitted in previous form
1
2
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!