Salir
  • Comunidad global
    • Idioma:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티

I am working on creating a pdf form using Adobe X pro to in my job and looking to take a Starting Number and have it go up by one every time it is used does anyone know how I can do it? I am using Java Scripts for other thing in the form?

Invitado
Mar 30, 2016 Mar 30, 2016

I am working on creating a pdf form using Adobe X pro  to  in my job and looking to take a Starting Number and have it go up by one every time it is used does anyone know how I can do it? I am using Java Scripts for other thing in the form?

TEMAS
Acrobat SDK y JavaScript , Windows
753
Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines

correct answers 1 respuesta correcta

Community Expert , Mar 31, 2016 Mar 31, 2016

- You can add the code that increments the value of the counter field to your existing code. For example, put it in the SetFieldValues function.

- Under the Properties of the drop-down field, in the Options tab, tick the box that says "Apply the selected value immediately".

Traducir
Community Expert ,
Mar 30, 2016 Mar 30, 2016

Let's say the field is called Counter. Enter this code as a new script under Tools - JavaScripts - Document JavaScripts (call it "init", for example):

this.getField("Counter").value = Number(this.getField("Counter").value)+1;

If you don't want that number to be reset when the form is cleared, enter this line as well:

this.getField("Counter").defaultValue = this.getField("Counter").valueAsString;

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Invitado
Mar 31, 2016 Mar 31, 2016

TRY67 Thank you for your Suggestion I placed both lines in the same script and it does not appear to work . i have info being Filled out based on a drop down Choice . it is not clearing the number when i reset it based on the drop down but the  number is not increasing. also do you know how to change the form based on the dropdown choice without having to reset every time?

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Community Expert ,
Mar 31, 2016 Mar 31, 2016

Check the JS Console (Ctrl+J) for error messages.

I don't quite understand what you mean about changing the form based on a dropdown choice.

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Invitado
Mar 31, 2016 Mar 31, 2016

on my form I am using the a dropdown to Populate the fields on the form via a Java Script (see below) . when I switch to the Blank Selection it reset the form using

if( event.willCommit ) {

    if(event.value == "") this.resetForm(["DeptContact","DeptEmail","DeptNumber"]); else SetFieldValues(event.value);

}

then using the Java Script below I am Populating some of the fields  to auto fill in based on my Choice from the drop down.  

// Place all pre-population data into a single data structure

var DeptData = { Accounting:{ contact: "Steala Damuni", email: "accounting@mycomp.com", deptnum: "cmp1234" }, Engineering:{ contact: "Frank N. Stien", email: "engineering@mycomp.com", deptnum: "eng1234" }, Marketing :{ contact: "Shelly Oughtbuks", email: "marketing@mycomp.com", deptnum: "mkt1234" }, ITSupport:{ contact: "Goah Wei", email: "it@mycomp.com", deptnum: "its1234" }};

function SetFieldValues(cDeptName) {

    // Populate fields with values from the Department Data Object

    this.getField("DeptContact").value = DeptData[cDeptName].contact;

    this.getField("DeptEmail").value = DeptData[cDeptName].email;

    this.getField("DeptNumber").value = DeptData[cDeptName].deptnum;

}

I am trying to get the job # field to add one when I switch jobs and then also when switching from ( MASS_FAMILY_STATEMENTS to NORTHERN LIGHTS STATEMENTS   it to switch the data  with our having to Click on the Blank to Reset the Form

JOB FORM.gif

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Community Expert ,
Mar 31, 2016 Mar 31, 2016

- You can add the code that increments the value of the counter field to your existing code. For example, put it in the SetFieldValues function.

- Under the Properties of the drop-down field, in the Options tab, tick the box that says "Apply the selected value immediately".

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines
Invitado
Mar 31, 2016 Mar 31, 2016
MÁS RECIENTES

Thanks that worked

Traducir
Informe
Directrices de la comunidad
Sé amable y respetuoso, muestra títulos de crédito de la fuente de contenido original y busca duplicados antes de publicar. Más información
community guidelines