Hide options in a select field - [Solved]

More
12 years 8 months ago #17749 by Rehne

aloisio wrote: Hello

I use flexicontent 1.5.4.
I'm trying to prove with "css" in a form in the "frontend".
I created a field type "select" and have given the field name "asig-bruno"
I want to hide this field in the form.
I am using the "Add css to edit form" where he wrote:

"#adminForm #asig-bruno {display: none;}"

but the field still appears.

In my HTML editor works.
What's wrong?


try it this way
template code
Code:
<?php if (isset($this->item->positions['yourposition'])) : ?> <div class="lineinfo subtitle1"> <?php foreach ($this->item->positions['yourposition'] as $field) : ?> <div class="element"> <?php if ($field->label) : ?> <div class="label field_<?php echo $field->name; ?>"><?php echo $field->label; ?></div> <?php endif; ?> <div class="value field_<?php echo $field->name; ?>"><?php echo $field->display; ?></div> </div> <?php endforeach; ?> </div> <?php endif;?>

CSS
Code:
#adminForm .label.field_asig-bruno {display: none;}

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

More
12 years 8 months ago #17753 by aloisio
I will try.
Thank you.
Regards.

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

More
12 years 8 months ago #17756 by aloisio
Sorry. What is the file which I add the code you sent me?
A template is composed of several files.

Regards

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

More
12 years 8 months ago #17767 by Rehne

aloisio wrote: Sorry. What is the file which I add the code you sent me?
A template is composed of several files.

Regards


are you talking about a field in the frontend submission form?

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

More
12 years 8 months ago #17768 by aloisio

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

More
12 years 8 months ago #17769 by ggppdk
Rehne, thank you for your answer, but alosio wants to hide some of the options that the select field, WHEN the field is displayed in the frontend submission-form.

And this to be done for a specific user.

We have 2 option to either alter the generation of option list when field is created (via PHP) by using the current user id,
or to use javascript and hide when form is displayed at the browser.

The first is more suitable, but somewhere must be kept information about which options the user can see and this has to be in a new table, and then the field options should be created by an sql query that also uses current user id.

Using replacable tags like "{current_user_id}" is not supported by the 'SQL query' textarea in the select field options, also after that, alosio would have to create the table too that would hold the data for the options.

After this post i plan to put replacable tags for the SQL query. But even after this is done, it requires some knowledge and time to create the table with the options.

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.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.274 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