Submit Form Button that locks (change to read-only) only fields that contain data

New Here ,
Jul 21, 2022 Jul 21, 2022

Copy link to clipboard

Copied

Hello

 

I have several forms that we supply to customers, they input data and submit the forms to me. However the forms also include fields for our internal use. I want the fields that contain information to be locked, but any fields that do not to remain editable. Then submit the form via email.

I'm wondering if this can all be done in one button press?

 

Thanks in advance

TOPICS
Create PDFs , JavaScript , PDF forms

Views

27

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Jul 21, 2022 Jul 21, 2022

Copy link to clipboard

Copied

Hi there

Hope you are doing well and thanks for reaching out.

The workflow you are trying to achieve might be possible using JavaScript. For more information please check the help pages listed below:
https://acrobatusers.com/tutorials/javascript_console/
https://helpx.adobe.com/acrobat/using/applying-actions-scripts-pdfs.html

Hope it will help

Regards
Amal

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Jul 21, 2022 Jul 21, 2022

Copy link to clipboard

Copied

LATEST

You can do it using this code:

 

for (var i=0; i<this.numFields; i++) {
	var fname = this.getNthFieldName(i);
	var f = this.getField(fname);
	if (f==null) continue;
	if (f.type=="button" || f.type=="signature") continue;
	if (f.valueAsString!=f.defaultValue) f.readonly = true;
}

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines