Template Page - Checkbox Autofill Fields - Javascript

Advocate ,
Oct 23, 2018 Oct 23, 2018

Copy link to clipboard

Copied

Hello...

I have a two page PDF form, on he second page I have a checkbox with simple javascript that will fill/delete the content of address field when checked.

if (event.target.value!="No")

    this.getField("e_lieux").value=this.getField("lieux").value;

if (event.target.value!="Yes")

    this.getField("e_lieux").value="";

if (event.target.value!="No")

    this.getField("e_ville").value=this.getField("ville").value;

if (event.target.value!="Yes")

    this.getField("e_ville").value="";

This works fine but the issues I have is that I have a third page hidden template (a copy of the second pages) that I can add to my form. When doing so, it does not works since the fields "lieux" and "ville" get renamed to something like so "P2.nameoftemplate.lieux" and "P2.nameoftemplate.ville".

Is there a way around this? A way to write the name of the field with whatever might come before, BUT stay of the current pages only, since we can have a fourth, or fifth or more added copy of the template.

Thanks!

TOPICS
PDF forms

Views

148

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
Explorer ,
May 10, 2022 May 10, 2022

Copy link to clipboard

Copied

LATEST

I'm following this. I'm in a similar situation.

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