548 Posts
joomleb
7 years ago
Topic

Hi guys,

Please, I have some Registration fields need to be set as "Read only", I have two situations:

1 - After its first input, like Birthdate (after setted never can change)

2 - After its first input an Administrator have to check (from the front-end) its value manually and then turn it as "Read only" (because that value will cannot never change)

Please, Do you have any suggestion on How to ?

Many Thanks for Help and Support

Get a Book for SEBLOD
4229 Posts
Kadministrator
7 years ago
1
Level 1

You can solve this with restrictions and double fields with same storage, for first problem put Add restriction on one and Edit on another with second field set as read only. For second problem you can use permissions based restriction to show readonly field to normal users and allow editing only for admins.

548 Posts
joomleb
7 years ago
0
Level 2

Hi Klas,

1 - I don't understand your suggestion, Do you mean ?!? :

FieldA - 1 Variation - Hidden when filled (*)

FieldA - 1 Variation - Readonly (*)

And, please, there, What does it mean "Value (*)" ?

1283 Posts
Bucklash
7 years ago
6
Level 1

Hi

1

Have a field for workflow 'Add'

and field for workflow 'Edit'

Add a conditional to the 'edit' field like: 'field 'is disabled' when filled. 

2

Could have a select simple field in form with :

Confirm Value? 

Yes=1

No=0

Restriction based on usergroup or Admin... and then conditional...

If 'select simple = 1 then field is disabled. 

4229 Posts
Kadministrator
7 years ago
5
Level 2

I was talking about restrictions, not field variations, see manual.

548 Posts
joomleb
7 years ago
4
Level 3

Hi guys, 

really many thanks on help to understand well. Now,

"Action: This setting lets you define the if you want the field to be displayed only when the Content Item is being submitted for the first time (Add), or when the Content Item is opened for editing (Edit), or Always for both."

Please, what should happen in case of an administrator pre-imported datas ?

A - The action set read if the field is empty - the administrator imported the datas, so the field is not empty = The Action setting calculate the fied yet Added from the User.

B - The action set read the User bahaviour - the administrator imported the datas, field is not empty but the User haven't click yet on Submit button for the first time (Add) = The Action setting calculate the fied as NO yet Added

4229 Posts
Kadministrator
7 years ago
3
Level 4

 Whether field is empty or not is irrelevant, when user or admin opens already existing item it will activate edit restriction. If you need to show/hide fields based on another fields value (empty or certain value etc) you can use Seblod fields restriction https://www.seblod.com/store/extensions/19160

548 Posts
joomleb
7 years ago
2
Level 5

Hi Klas,

thanks for suggesting and sorry for my bad English, I meant to say:

- I set field restriction as: Action > Add (I want the field to be displayed only when the content item is being submitted for the first time)

- Using import plugin I import datas field

The field, with the imported value, but not yet submitted for the first time, should be visible or not ?

4229 Posts
Kadministrator
7 years ago
1
Level 6

Hi,

when you import data with importer it creates an item, so it already exists and when opened it will be Edit, not Add.

548 Posts
joomleb
7 years ago
0
Level 7

Hi Klas, 

thank you very much for the explication, 

I'm testing it :)

Get a Book for SEBLOD