Forum Discussion
2 Replies
- GopikrishnanAccelerator II
Hi Balaji
You can write a JavaScript method and add to form events to disable / enable field based on state of an item.
Example Pseudo code (based on state, you can hide fields).
Event : on Form Populated in form
Method:
var itemState = aras.getItemProperty(parent.item, "state");alert(itemState);if(itemState == "Preliminary"){// Disabling Fields of type Item. For other data type refer the linksetTimeout(function(){getFieldByName("owned_by_id").getElementsByTagName("input")[0].disabled = true;getFieldByName("owned_by_id").getElementsByTagName("button")[0].disabled = true;}, 1);}else{// Disabling Fields of type Item. For other data type refer the linksetTimeout(function(){getFieldByName("owned_by_id").getElementsByTagName("input")[0].disabled = false;getFieldByName("owned_by_id").getElementsByTagName("button")[0].disabled = false;}, 1);}Thank You - BalaVizIdeator I
Thank you so much, Gopikrishnan!
I happened to notice this blog already and managed to disable/enable the fields listed in there successfully. But it is still seemingly tricky to disable a 'File Item' field for example. The elements I find using the browser console does not seem to match correctly.
Have you tried disabling File Items?
Cheers,
Balaji.