Why cannot Date Element be Read Only

Status
Not open for further replies.
I have a situation where I need a read only Data Element on the form. The user must have UPDATE rights but I am controlling the field from a .js function.

Now I must leave the field open which which could cause a problem for me if the user choose to overide my computed value
 
Not sure when your code runs but you can always set it to readonly manually.

Code:
$('listname___date_cal').set('value', 'SomeKindaValue').set('readOnly', true);

However the reason it doesn't have a readonly option could be simply nobody has asked for it before.
 
Hi Felixkat,
That did not work

I did find another post in the Fabrik2 Bronze which suggested:

$('tender_invitees___tender_closingdate').setAttribute('disabled', 'disabled');
$('tender_invitees___tender_closingdate').addClass('readonly');

It makes the area AROUND the field gray (not the date field itself) but still allows the date to be changed with the calendar....

I first thought it does control the input field but when I went to the element and changed the settting "Allow Typing in Field" to Yes then it transpired the code above did nothing, just made the stuff around the element grey, not the even field itself.
 
Ah .... Shultz, I found it. Hidden in the Date element itself

In the "ADVANCED" section you add:

var result = true;

and you ensure "Allow Typing in Field" = No

It then disables the calendar selector, user cannot type in the field and achieves my "Read Only"

These Fabrik okes are geniuses .....

It does highlight the fact for me that there is a dire need to actually document each element with its properties and how it works properly. There are so many hidden little tricks ...frightening (for me)
 
Thanks Rob, i did in fact consult the wiki first before reverting to the forum. I did go and check now just in case i missed something. There is no mention at all about the way to use of the advanced option and the "the var result = true" as a wy to achieve read only.

No an issue as i did come right in the end. Would you suggest that i add that to the wiki? I could register and help out here and there from a fabrik novice's point of view. If key learnings from the forum gets transferred to the wiki it will actually prevent a lot of queries as the added detail would be documented at the source object in question. I have in fact started writing my own "manual" to document the basic framework of a system in order to do a fabrik skills transfer to the guys who must take over the sites from me.
 
In the "ADVANCED" section you add:

var result = true;
Ah ok so thats for the 'allow date function'
Indeed we don't say anything about it, so yes you could add that to the wiki :)
The hover tip does have some additional info on that function that might be useful as well. :)

I think we have to whitelist you once you've signed up at the wiki, so if you cant edit pages let me know and ill alter your account status for that.
 
Status
Not open for further replies.
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top