Hello,
In a efg form , could it be possible to set a field to disabled,
the user will be able to see the content of the field without having the possibility to modify it
Thanks for replying
Hello,
In a efg form , could it be possible to set a field to disabled,
the user will be able to see the content of the field without having the possibility to modify it
Thanks for replying
Sharing and growing
Hello,
Just an up about this post :
I havent seen some background means to disabled a field in a form.
Could you help?
Thank you from South of France
Sharing and growing
Yes.. could someone explain (using TL2.8) how exactly to set a text field in an efg form to be either 'disabled' or 'readonly'.
Follwing other posts e.g. http://www.typolight-community.org/v...=disable#p4594 I have inserted the following into my form DCA in the relevant field section
..but it seems to make no difference at all. I am obviously missing something! I've tried various combinations of disabled/readonly = disabled/readonly/true with no success.Code:$GLOBALS['TL_DCA']['tl_formdata']['fields']['mklotid']['eval']['disabled'] = true;
OK.. i'm getting closer - it DOES work but for the BE only - so the question is, how do I get this field to be disabled/readonly in the FE?
Sorry to go on about this, but I would be grateful if someone could comment/put me straight on the this issue.
I did notice that the first function in the ...\frontend\FormTextField.php module does contain a 'readonly' case statement (re adding attributes). Thus, having set the DCA for an efg form field (manually, as in previous post) to be 'readonly', why does this work in the BE but not in the FE? (or...what have I missunderstood/am doing wrong?!)
Hello,
I found a solution about my problem ...
in a loadFormField hook, and about the targeted fields (filtered by $strForm and $objWidget)
I inserted the following instruction :
$objWidget-> __set('disabled',"1");
And for me, it works fine for textfield or selectmenu item as I wished
Cool, is't it ?
Sharing and growing
Hello,
It's not so good ...
I am searching some means to manager a form with a readonly and mandatory field ...
This field is set to mandatory in the form manager of the backend
It is initialised too with a defauklt value in this form
In a loadFormField hook about this form
this fiels is set to a value (with a fonctionnal meaning) with a __set('value',valeur) on the target widget
it is also set to readonly on the same widget
All is good : the field is displayed with the good value and it is in readonly mode.
But:
after the form is validated , TL tells me , that the field is mandatory, by a error message..!
I found nothing inside TL except that :
the error message is set because nothing is entered in the related input object
Some one can help me ?
Thanks
Sharing and growing
Bookmarks