It's all about the answers!

Ask a question

Making text readonly as read-only on the basis of validation script

Sajjad Ali Khan (311751) | asked Aug 27 '15, 6:02 a.m.

Dear All,

I need to create a validation script where the scenario is:

1, There is a custom attribute which has YES/No radion buttons

2, There is text field

If user click No on the radio button then the text field will become read-only, following is the script which have created but its not working and giving some errors in a log which is also available below, i have also define it within RTC client > Workitems > Attribute Customization > Validations

Please help me to resolve this issue and achive what i want to achieve





(function() {

var WorkItemAttributes =;

dojo.declare("org.example.workitems.providers.testvalidation" , null, {

matches: function(workItem, configuration){

var rfc = workItem.getValue("arabbank.attribute.rfcisaproject");


if(rfc == "arabbank.enumeration.rfcisproject.literal.l2"){

return ("arabbank.attribute.EPMOReference").readOnly = true;


return false;




Log from the script:


!MESSAGE Error invoking validator
!STACK 0 Executing Javascript failed.
 at sun.reflect.GeneratedMethodAccessor109.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(
 at java.lang.reflect.Method.invoke(
 at com.sun.proxy.$Proxy43.validate(Unknown Source)
Caused by: 'validate' is not a function
 at com.sun.proxy.$Proxy64.validate(Unknown Source)
 ... 11 more

One answer

permanent link
Donald Nong (14.4k313) | answered Aug 28 '15, 3:13 a.m.
edited Aug 28 '15, 3:14 a.m.
The script format is a "condition" script, why do you call it a "validation" script? You have made a condition script in a previous post (with an incorrect conditional testing though), why don't you just follow it as an example?

In the script above, this line is absolutely incorrect.

return ("arabbank.attribute.EPMOReference").readOnly = true;

Sajjad Ali Khan commented Aug 28 '15, 3:37 a.m. | edited Aug 30 '15, 9:35 p.m.

 Donald Nong you told me in this post

that you need to create another script for making in read-only in validations script. so i have created as you have said but still i'm not able to achieve what i want achieve.

Kindly me help me out in this case if can guide how to make my script correct or if have that working script for my case

Please help me out.

Donald Nong commented Aug 30 '15, 9:37 p.m.

The "another script" is a condition script, not a validation script. You use a validation script to ensure the attribute is mandatory. You use a condition script to make the attribute read-only.

Your answer

Register or to post your answer.