How to make field Read Only after Selecting certain option from dropdown list ?
Hi,
i am creating a Dropdown for a team selection, and want the field below to autofield depend on the dropdown selected.
The Dropdown (TeamName) selection are :
Team1
Team2
Team3
the option for the the "Captain" Filed are,
if Team1, "Andy" ; If Team2, "Bob", If Team3, a free text that i can fill in later.
the problem is, i want to have that if Team1 and Team2 is selected the field will be ReadOnly/Protected, if Team3, then we can edit the field.
I've Tried this, the selection is okay, but it wont make the field as readOnly, can anyone help please.
var one = this.getField('TeamName');
var two = this.getField('Captain');
if (one.value == 'Team1')
{
two.value='Andy';
two.access="readonly"
}
if (one.value == 'Team2')
{
two.value='Bob';
two.access="readonly"
}
if (one.value == 'Team3')
{
two.value=' '
}
Thank you
