I have a script to change all text fields to read-only but I need it to only change to read-only if all the required fields are completed
Hello, I have the following script which changes all my text fillable fields into read-only fields.
for(var i = 0; i < this.numFields; i++) {
var fieldName = this.getNthFieldName(i);
if (this.getField(fieldName).type == "button" ||
this.getField(fieldName).type == "signature")
{
//console.println(i+":no:"+fieldName);... used in the debugger
}
else {
//console.println(i+":"+fieldName);... used in the debugger
getField(fieldName).readonly = true;
}
}
I also have a submit form option which will validate and ensure all required fields are completed.
The issue i'm having is that even if some fields are no completed, by clicking the button it will change all fields to read only, is there a way for my script to only run upon completion of all required fields?
Thank you in advance,