Hide options in a select field - [Solved]

More
14 years 6 months ago - 14 years 1 week 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: 14 years 1 week ago by aloisio.

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

More
14 years 6 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 review. Thanks!

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

More
14 years 6 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
14 years 6 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
14 years 6 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
14 years 6 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.

More
14 years 6 months ago #17726 by aloisio
You tell me that what interested me (hide certain options for certain users) will be implemented in the new version of flexicontent?
Can I do something to make development faster?

Regards

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

More
14 years 6 months ago #17729 by ggppdk
I am struggling with time working 12-14 hours per day and have a important deadline, i will be away from forum until 12-14th of month ...

What ask could be useful, it can be done per user if we enhance the SQL query for select to support replaceable tags
e.g.
{current_user_id}

Then create a mysql table which you will query, of course this soultion is mainly for developers ...

If it was public user <--> registered user then it will be simpler, maybe with a little PHP / a little CSS

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 review. Thanks!

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

More
14 years 6 months ago #17734 by aloisio
Sorry, I don't understand you.

Regards

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

More
14 years 6 months ago #17743 by micker
For futur a template système for form is interesting not ?

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

Moderators: vistamediajoomlacornerggppdk
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
Save