Copy link to clipboard
Copied
I have dropdownA include 1~5, if you choose 1 from dropdown, i want entryfield1 to grayoout.
If i choose 2 from dropdown, I want entryfield2 to grayout.
How I can get with javascript?
By greyout you want to set it to readonly?
As custom calculation script of that dropdown, use this:
this.getField("entryfield1").readonly = event.value == 1 ? true : false;
this.getField("entryfield2").readonly = event.value == 2 ? true : false;
Copy link to clipboard
Copied
By greyout you want to set it to readonly?
As custom calculation script of that dropdown, use this:
this.getField("entryfield1").readonly = event.value == 1 ? true : false;
this.getField("entryfield2").readonly = event.value == 2 ? true : false;
Copy link to clipboard
Copied
Thank you, Nesa!
I want to set it to read-only.
Could you also tell me for following case?
If you choose no3, set read-only for entryfield1 and entryfield2.
Copy link to clipboard
Copied
Use this:
var e1 = this.getField("entryfield1");
var e2 = this.getField("entryfield2");
e1.readonly = event.value == 1 || event.value == 3;
e2.readonly = event.value == 2 || event.value == 3;
Copy link to clipboard
Copied
Dear Nesa,
Thank you for your reply.
When I set this code to the Javascript editor of entryfield1, it tells me like below.
Syntax Error missing ; before the statement
Could you tell me how to solve this?
Copy link to clipboard
Copied
I also wonder if should I set this code to dropdown javascript editor or entryfield1 script editor.
Copy link to clipboard
Copied
In my first post, I wrote to use script as custom calculation script of that dropdown.
There are no syntax errors in script, make sure you copy/paste script correctly.
Copy link to clipboard
Copied
Thank you for your prompt reply.
Yes, it works!
I missspelled...
Thank you so much again for your help!