Hello,
In my document definition, I have individual checkmarks (NOT in a checkmark group) that are based on object collections in the corresponding FlexiLayout. The checkmarks represents boxes on the form where someone would put their signature and signature date. I created the object collection/checkmark to verify that ANYTHING has been written into these signature and signature date boxes.
I'm trying to create a script rule for the signature box that throws an error if either the signature or signature date checkboxes are NOT filled in when an insurance type of "Medicaid" is chosen in a checkmark group on top of the page. Here is the script rule code:
if (this.Field("grpInsuranceType").Field("chkMedicaid ").Value == true)
{
if ((this.Field("chkClientSign").Value = false)
|| (this.Field("chkClientSignDate").Value = false)
|| (this.Field("chkEmployeeSign").Value = false)
|| (this.Field("chkEmployeeSignDate").Value = false))
{
this.CheckSucceeded = false;
this.ErrorMessage = "Both the Client and Employee Signatures/Dates are required for Medicaid Patients!";
}
}
When I save the document definition and test it against a form example, I get the following error:
"Unable to modify a read-only field 'chkClientSign'
Can someone tell me why my script would result in this error?
Thanks,
Ben Holton
In my document definition, I have individual checkmarks (NOT in a checkmark group) that are based on object collections in the corresponding FlexiLayout. The checkmarks represents boxes on the form where someone would put their signature and signature date. I created the object collection/checkmark to verify that ANYTHING has been written into these signature and signature date boxes.
I'm trying to create a script rule for the signature box that throws an error if either the signature or signature date checkboxes are NOT filled in when an insurance type of "Medicaid" is chosen in a checkmark group on top of the page. Here is the script rule code:
if (this.Field("grpInsuranceType").Field("chkMedicaid ").Value == true)
{
if ((this.Field("chkClientSign").Value = false)
|| (this.Field("chkClientSignDate").Value = false)
|| (this.Field("chkEmployeeSign").Value = false)
|| (this.Field("chkEmployeeSignDate").Value = false))
{
this.CheckSucceeded = false;
this.ErrorMessage = "Both the Client and Employee Signatures/Dates are required for Medicaid Patients!";
}
}
When I save the document definition and test it against a form example, I get the following error:
"Unable to modify a read-only field 'chkClientSign'
Can someone tell me why my script would result in this error?
Thanks,
Ben Holton
Comments
3 comments
Ben
Just for the benefit of anyone else reading this thread, the problem was with the person controlling the keyboard.
I used the single "=" operator in the IF statement, which in JavaScript means that you're trying to ASSIGN a value to that variable. This is why I received the "unable to modify a read-only field" error.
What I should've used was the "==" operator, which compares the variable to the value to the right of the == operator. Once I did this, the error went away.
Thanks!
Ben Holton
Please sign in to leave a comment.