Make all form fields read only except generated template page
I have a two page form that once the user fills out and signs they click the submit button. The submit button has added to it a action mouseup javascript that makes all the fields read only and also generates a template page that is for admin use. So the idea is that once the form is submitted the person receiving the form on the other end will not be able to touch the fields on the first two pages but in the third page generated from the template.
I have two scripts running in the button plus submit form:
The first to generate the template page and hide two buttons:
var a = this.getTemplate ("AdminUse");
a.spawn();
this.getField("Submit").display = display.hidden;
this.getField("Reset").display = display.hidden;
The second to make all fields read only:
//getField("Text_Field").readonly = true;
for(var i=0;i<this.numFields;i++)
{
var fieldName = this.getNthFieldName(i);
if (fieldName == "FOR_ADMINISTRATION_USE_ONLY")
{
//console.println(i+":no:"+fieldName);... used in the debugger
}
else
{
//console.println(i+":"+fieldName);... used in the debugger
getField(fieldName).readonly = true;
}
}
The second script is making everything read only. Which is almost what I want but not quite. I need the field named "FOR_ADMINISTRATION_USE_ONLY" to remain fillable. Please help. What is wrong with the script? I'm struggling to find the correct solution to make that one field fillable.
