Forums

readonly attribute

Benvenuto 06 Jul, 2013
Hy all,
I'm trying to use readonly='readonly' in the Field class of a text box to make it not editable by the user, but once it has filled by DB record loader in the onload event, it still is editable.
It seems a simple problem, but I'm not able to ...
Thanks in advance
Vince
GreyHead 07 Jul, 2013
Hi Vince,

I'm surprised that putting readonly in the class box does anything at all. If you are using the code from this FAQ then you need to make sure that it is run again when page reloads.

Bob
Benvenuto 07 Jul, 2013
In the attachment what I set in the field configuration.
But I did not add the JS of the FAQ you have mantioned.
I have to add that Load JS action in the on load event?
I just used another Load JS for different pourpose, if it is the case, I can add a different Load JS or I have to merge both?.
Thank you Vince
GreyHead 10 Jul, 2013
Hi Benvenuto,

You can use the same Load JS action for all your scripts (though it will still work if you use more than one).

Bob
Benvenuto 22 Jul, 2013
Hi Bob!
I arranged my form accornding your suggestion (this FAQ) and now it works, but only for the first cfdiv_text input of my form. How can I arrange to make it works with all the text inputs (and also with other fields) of my form?
Thank's a lot.
Vinc
GreyHead 22 Jul, 2013
Hi Benvenuto,

If it only works on the first text input then you may have a typo in the code. Please post a link to the form so I can take a quick look.

Bob
GreyHead 22 Jul, 2013
Hi Vinc,

Thank you, I can see where the problem is now. The inputs that also have validation break the JavaScript. I'll see if I can work out a way to fix it.

Bob
This topic is locked and no more replies can be posted.