Hide options in a select field - [Solved]

More
12 years 8 months ago - 12 years 2 months ago #17708 by aloisio
Hello
I use flexicontent 1.5.4
I created a field type "select" on a form in the "frontend".
I want to hide some options of this field to a registered user.
I can use the "Add css to edit form" to do that?
What is the syntax for that?

Regards
Last edit: 12 years 2 months ago by aloisio.

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago #17720 by ggppdk
If you were to hide the field itself for individual users, you could do it with FlexiAccess permissions.

But there is no easy way to hide individual options, without modifying the code the select field.

I plan to extend the select field of 1.5.6 to make it more powerful. This but end of month, I will then post the modified field here.

Regards


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago #17721 by aloisio
Hello.

Adding code "css" to the "Add css to edit form" is not possible?

Regards

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago #17722 by yopyop001
Hi,

By css, i think it'not possible to hide option of a select field.

May be you can use a javascript like :
Code:
document.FormName.SelectName.options[i].style.display = 'none';
where i is the option you want to hide.

You can use joomla template overriding for the form template and add a line
Code:
$this->document->addScript('url_of_your_javascript.js');

Not sure that it works, but you can try.

regards

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago #17723 by aloisio
Hello

Each user to send items with use the same form with the same field "select" should show different options.
Is the code that you sent me can do this?

Regards

Please Log in or Create an account to join the conversation.

More
12 years 8 months ago #17725 by yopyop001
Not sure... may be with an array which make links between user and options, but in my mind it's an unmaintainable solution...

No idea to do that... Sorry

Waiting the extended field?

I plan to extend the select field of 1.5.6 to make it more powerful. This but end of month, I will then post the modified field here.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.286 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline