Create a custom field with value already filled in and not changeable

  • David Unwin
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
2 years 10 months ago #154479 by David Unwin
We want to have a custom field in our subscription information.
This field will apply to both group admins and group members on one of our plans
This filed will also determine the Joomla group we assign the group member to.
We want the value to be fixed.
I tried setting the field as a LIST field with only one value and setting the default to the same value.
The problem with this is that the group admin can turn off the value by choosing SELECT. against the field
I have tried hiding this field on the form, but then the field is not filled in with the default.
Also the option to carry through from the Group admin field does not appear to work?
See screen shot for more information
Any ideas how I can achieve this?

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

More
2 years 10 months ago #154484 by Tuan Pham Ngoc
Hi David

I think you can try the options below to see if it works:

1. Set the field Required (set Required to Yes) so that group admin cannot choose Select option

2. Or hide the field using css

Could you please try that to see if it works?

Tuan

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

  • David Unwin
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
2 years 10 months ago #154489 by David Unwin
Hi Tuan,
I changed the field type to Radio and set the required field to Required to YES as you suggested...This worked fine....Thank you. See screen shots of settings and output.
I would also like to hide the field on display with css.
I see in the field elements there is Display Settings/ CSS Class.
I tried setting this to 'hide'
and then in Custom css I set #Hide {display:none;}
but it did not work? what am I doing wrong there?
David

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

More
2 years 10 months ago #154490 by Tuan Pham Ngoc
Hi David

That's not right css solution. You need to add css code to hide the whole div. Something like

#field_first_name
{
display: none;
}

Replace first_name in the above code with name of the custom field and it should work well

Tuan

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

  • David Unwin
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
2 years 10 months ago #154491 by David Unwin
Hi Tuan,Yes that works fine.... Thank you
.I also wanted to stop the display of the TITLE. So I set the css to the following 
Note 'type_fa1' is my field name
#type_fa1
{
display: none;
}
Below is the css to stop displaying the TITLE
#type_fa1-lbl
{
display: none;
}
This works fine. Note to other users: for this to work make sure there is that the Description of the field is empty, otherwise the Title will display

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

More
2 years 10 months ago #154494 by Tuan Pham Ngoc
Your css looks a bit strange to me. But if it works, I'm fine. Please continue using the extension and if you need help, please don't hesitate to ask

Tuan

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