Disable to edit through dropdown status.

procajlok

Member
Hello!
I have a question. In my system every user create one application to register group. They fill out the form. And now - how simply i can manage disable or enable field in this form to edit by user (admins can change every time all field from backend), by additional field "status" in form (visible only for admins)? "Status" field can disable or enable to edit every field in form, or every group field in form - for me it makes no difference ;)

In example - when admin change status in dropdown field to "in verification", user cannot change his application. When admin change status to "Please correct" - user can change.

And second - in application, when user fill all fields and finish application, we have last field-button. How i assign action for this button -> Change field "Status" to "In verification" (and in next step disable for edit every field for user)? By Javascript? :)

Regards! ;)
 
You can control whether the user can edit the form itself by using a 'caneditrow' list plugin, with PHP ...

Code:
return '{yourtable___status_raw}'  == '1'

... replace that name with the full element name of your status element (with _raw add), and the value that allows them to edit.

But there isn't a way to individually make elements or groups editable or not editable like that.

To update 'status', a JS action on the button element, on 'click', with the custom code ...

this.form.formElement.get('yourtable___status').update('2');

... or whatever the value you needs is.

NOTE that when I say "value" I mean the value you assigned to the labels for the dropdown options. It's usually best to use numeric values to represent each option.

-- hugh
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top