PDF Form JavaScripts Dependent Dropdown Menus

แชร์
ฝัง
  • เผยแพร่เมื่อ 27 ธ.ค. 2024

ความคิดเห็น • 72

  • @cscscs3618
    @cscscs3618 7 หลายเดือนก่อน +2

    FINALLY!!! Something that works!!! Thank you!!

  • @ibrahimalsoufi7289
    @ibrahimalsoufi7289 2 ปีที่แล้ว +1

    Could you please advise about dependent text fields? The value of one field depends on what is written on the other one?

  • @trianisholihah9126
    @trianisholihah9126 7 หลายเดือนก่อน +1

    Hi, I've followed the steps and the logic is correct, but the second dropdown menu won't appear. Why is that?

  • @jasonpagan4722
    @jasonpagan4722 3 ปีที่แล้ว +1

    This definitely helped. Thank you!

  • @anavargas883
    @anavargas883 3 ปีที่แล้ว +1

    Amazing video!!! Super helpful!

  • @primeiragestao2648
    @primeiragestao2648 ปีที่แล้ว +1

    I appreciate your support, I´m trying to do this scrip to appear "N/A" in the dropdown list DBRR if i choose "YES" in the first dropdown, but it not working
    var Itemlist = this.getField("DBRR");
    if(event.willCommit)
    {
    switch(event.value) {
    case "YES":
    Itemlist.setItems(["N/A", "Test"]);
    default:
    Itemlist.setItems([""]);
    }
    }

    • @pdfform
      @pdfform  ปีที่แล้ว

      plz check our intermediate tier patreon page

  • @hazelcalica
    @hazelcalica ปีที่แล้ว

    How do I add another dependent dropdown menus with the same set of choices? The first dependent dropdown menu works but the 2nd, the options are not appearing.

    • @pdfform
      @pdfform  ปีที่แล้ว

      message on our patreon page intermediate tier

  • @agelikima4069
    @agelikima4069 2 ปีที่แล้ว

    hello thank you for sharing . I have this question how do i clear field so they do not keep last selected? it is like they do not reset or start over. thank you

    • @pdfform
      @pdfform  2 ปีที่แล้ว +1

      just make a reset button

  • @sangeriz
    @sangeriz 3 ปีที่แล้ว +1

    Thanks great tutorial

  • @farb2009
    @farb2009 2 ปีที่แล้ว

    Thank you very much this one was helpful, do you have a similar script but to get a text and a number in some fields from a name selected in a created drop-down list, I believe they called dependable fields from a drop-down list, I wish I can attach a sample here, please let me know if something we can get in acrobat DC pro, Thank you

    • @pdfform
      @pdfform  2 ปีที่แล้ว

      join our fb group and post ur issue in detail

  • @joannp8184
    @joannp8184 2 ปีที่แล้ว

    Is there a way to set the name=value pair so that I have the export value?

    • @pdfform
      @pdfform  2 ปีที่แล้ว

      yes there is

    • @joannp8184
      @joannp8184 2 ปีที่แล้ว

      @@pdfform Is it a different tutorial?

    • @pdfform
      @pdfform  2 ปีที่แล้ว

      join our patreon page

  • @KhalilCh
    @KhalilCh 3 ปีที่แล้ว

    Thank you, But I need to change only text not another dropdown list, can I do that?

  • @rob19841
    @rob19841 2 ปีที่แล้ว

    If i want a dropdown list to have a list of "names" and then a text box automatically write something (just one word not a list) in accordance to what i select in the dropdown list how would i go about that?

    • @pdfform
      @pdfform  2 ปีที่แล้ว +1

      yes, it can be done

    • @jutilosws
      @jutilosws 2 ปีที่แล้ว

      @@pdfform Hi, please can you help me, the code is not runing.
      var itemlist = this.getfield("Items");
      var price = this.getfield("Price_Field");
      if(event.willcommit)
      {
      switch(event.value){
      case "Fruits":
      itemlist.setitems(["-Select Fruits","Apple"]);
      price.value = "";
      break;
      default:
      itemlist.setitems([""]);
      price.value = "";
      break;
      }
      }

    • @pdfform
      @pdfform  2 ปีที่แล้ว +1

      @@jutilosws the script is case sensitive.. this.getfield. should be this.getField

    • @jutilosws
      @jutilosws 2 ปีที่แล้ว

      @@pdfform Muchas gracias, el problema fue resuelto. Muchas gracias un fuerte abrazo desde Colombia.
      Dejo el codigo por si alguien mas lo requiere, es importante el tema de las mayusculas, ese era el error mio
      var Itemlist = this.getField("Items");
      var price = this.getField("Price_Field");
      if(event.willCommit)
      {
      switch(event.value){
      case "Fruits":
      Itemlist.setItems(["-Select Fruits","Apple"]);
      Price.value = "";
      break;
      default:
      Itemlist.setItems([""]);
      Price.value = "";
      break;
      }
      }

    • @jutilosws
      @jutilosws 2 ปีที่แล้ว

      ​@@pdfform hello friend, please look at this code, I am adapting it for what I really need it and it does not work correctly, not all the variables put the value that I assign, what can it be?
      correctly assigns the first four variables and thereafter does not assign them, does not display the value.
      Please I appreciate that you can help me
      var Equipo = this.getField("Equipo");
      var V1 = this.getField("V1");
      var V2 = this.getField("V2");
      var V3 = this.getField("V3");
      var V4 = this.getField("V4");
      var V5 = this.getField("V5");
      var V6 = this.getField("V6");
      var V7 = this.getField("V7");
      var Pozo = this.getField("Pozo")
      if (Pozo.value == "CP1701-GE")
      {
      V1.value = "BOP-0101"
      V2.value = "RTU-0101"
      V3.value = "TCO-0101"
      V4.value = "CONT-0101"
      V5.value = "CONT-0102"
      V6.value = "M-0101"
      V7.value = "xx"
      }
      else
      {
      V1.value="jj"
      V2.value="kk"
      }

  • @suberhajo1135
    @suberhajo1135 3 ปีที่แล้ว

    Is it possible to make an interactive pdf automatically save a read-only copy of the document via a button in the script?
    Thank you for the video!

    • @pdfform
      @pdfform  3 ปีที่แล้ว

      @Suber Hajo Yes, it is possible

    • @suberhajo1135
      @suberhajo1135 3 ปีที่แล้ว

      @@pdfform Thank you for the answer! Wow cool! Can you send me a link or something how its done?

  • @ganeshduttmehta7229
    @ganeshduttmehta7229 2 ปีที่แล้ว

    Hey, kindly share JavaScript, that if I select an item from the dropdown , a related field gets automatically filled as well as related image display in PhotoBox. Pls Help

    • @pdfform
      @pdfform  2 ปีที่แล้ว

      @ganesh dutt mehta You can use the script provided in the video titled "Upload Image in PDF | Adobe PDF Script to insert image in PDF form"

  • @nelsoncalabria3008
    @nelsoncalabria3008 3 ปีที่แล้ว

    I made a mistake when copying &pasting, in the line just after the default line. That error is not in the actual code, the one that is not working.

    • @nelsoncalabria3008
      @nelsoncalabria3008 3 ปีที่แล้ว

      @@pdfform Apologies, to disturb you. This my first time ever code in javascrip. It is not working. Now I know JS is case sensitive. My code>
      var Itemlist = this.getField("Tipo");
      var Cod = this.getField("Codigo");
      if (event.willCommit)
      {
      switch(event.value){
      case "Compra Circunstancial":
      ItemList.setItems(["-Seleccione","Anticipo","Saldo","Total"]);
      Cod.value = "";
      break;
      case "Compra Ordinaria":
      ItemList.setItems(["-Seleccione","Anticipo","Saldo","Total"]);
      Cod.value = "";
      break;
      default:
      ItemList.setItems([""]);
      Cod.value = "no aplica";
      break;
      }
      }
      Thanks you so much.

    • @pdfform
      @pdfform  3 ปีที่แล้ว

      @Nelson Calabria your issue that while creating variable Itemlist you have used smaller case of "l" but in the latter you have used capital "L". so the following script should go to the keystroke of the first dropdown:
      var Itemlist = this.getField("Codigo"); // Codigo is the name of the 2nd dropdown field .
      if (event.willCommit)
      {switch(event.value){
      case "Compra Circunstancial":
      Itemlist.setItems(["-Seleccione","Anticipo","Saldo","Total"]);
      break;
      case "Compra Ordinaria":
      Itemlist.setItems(["-Seleccione","Anticipo","Saldo","Total"]);
      break;
      default:
      Itemlist.setItems([""]);
      break;
      }
      }

  • @shahabuddin7346
    @shahabuddin7346 3 ปีที่แล้ว

    Hey, Is it possible to change color of same dropdown list for different option.
    For example - If I select green the box will turn into green, if I select red the box will turn into red.
    How do I do that please.

    • @pdfform
      @pdfform  3 ปีที่แล้ว

      @Shahab Uddin. yes it is possible

    • @shahabuddin7346
      @shahabuddin7346 3 ปีที่แล้ว

      @@pdfform Can you please share the script

    • @pdfform
      @pdfform  3 ปีที่แล้ว

      already made a video on this topic

  • @ThuyTran-fy1uc
    @ThuyTran-fy1uc 2 ปีที่แล้ว

    Thanks! I could make it from your video. But it do not work when I open the form in SharePoint (OneDrive). Please advise any way to fix it?

    • @pdfform
      @pdfform  2 ปีที่แล้ว +1

      @Thuy Tran. it wont work with any online platform..... its one of the demerits of pdf form that it only works with adobe acrobat reader or pro after download

    • @ThuyTran-fy1uc
      @ThuyTran-fy1uc 2 ปีที่แล้ว

      @@pdfform Is there anyway to do it for online platform?

  • @BadBadUser
    @BadBadUser 3 ปีที่แล้ว

    i tried this in acobat pro dc and did nothing in the second combo box when i selected the value in the first combo box

    • @pdfform
      @pdfform  3 ปีที่แล้ว

      @dark side SUBSCRIBE to our channel and join our facebook Q&A group and post your script there.

    • @Kevin457_starsky
      @Kevin457_starsky 3 ปีที่แล้ว

      Hi there, were you able to figure it out? I have made several attempts and just not working. I'm using Acrobat Pro DC as well. Thanks!

    • @BadBadUser
      @BadBadUser 3 ปีที่แล้ว

      @@Kevin457_starsky yes. did it again and it worked. 😉

    • @Kevin457_starsky
      @Kevin457_starsky 3 ปีที่แล้ว

      @@BadBadUser mine just did finally!!!. Thanks @PDF Form JavaScript!

  • @arequina
    @arequina 2 ปีที่แล้ว

    How do you do this in AEM Forms Designer?

    • @pdfform
      @pdfform  2 ปีที่แล้ว

      @arequina everything remains the same except for few syntaxes in the script.... ex- in acrobat we use event.value but in AEM we use this.rawValue .. etc..

  • @JoeGoreta
    @JoeGoreta 3 ปีที่แล้ว

    What is js code for this calculation: field1 + field2 + (field3 *2) + field4
    Regards

    • @pdfform
      @pdfform  3 ปีที่แล้ว

      @ Joe Goreta.
      event.value = this.getField("field1").value + this.getField ("field2").value + this.getField("field3").value *2 + this.getField("field4").value;

  • @hosseinshirmohamadi9126
    @hosseinshirmohamadi9126 2 ปีที่แล้ว

    I appreciate your time. It was litteraly helpful.
    How we can hide and show a field dependent on dropdown fields?
    I have a JS code wich works but I don't know how add more drop field to it.
    if (this.getField("Dropdown").value == "Field#1"){
    event.target.display = display.visible;
    }
    else{
    event.target.display = display.hidden;
    }
    How can I add more dropdown field to this code, like Field#2

  • @cptcosmo
    @cptcosmo 2 ปีที่แล้ว

    This script doesn't work in Bluebeam Revu Extreme either...

    • @pdfform
      @pdfform  2 ปีที่แล้ว

      It will only work with Adobe reader

  • @Brahma_Vishanu_Mahadev
    @Brahma_Vishanu_Mahadev 2 ปีที่แล้ว

    I am trying this code in "PDF Xchanger" But, it did not work...Can you please help?

    • @pdfform
      @pdfform  2 ปีที่แล้ว +1

      only works with adobe acrobat pro or reader

    • @Brahma_Vishanu_Mahadev
      @Brahma_Vishanu_Mahadev 2 ปีที่แล้ว

      Can you please help me with the code which can work in PDF Xchanger.?? This will be great help. I am trying this from week but not able to write. Correct code.

  • @jube1907
    @jube1907 2 ปีที่แล้ว

    Does this work in Adobe Acrobat IOS after you created it on PC?

    • @pdfform
      @pdfform  2 ปีที่แล้ว +1

      not all script work only selected ones

    • @jube1907
      @jube1907 2 ปีที่แล้ว

      @@pdfform thanks so simple ones like calculations with date fields would work?

    • @pdfform
      @pdfform  2 ปีที่แล้ว

      date calculation is not simple

    • @pdfform
      @pdfform  2 ปีที่แล้ว

      @@jube1907 you need to check if it works or not. but i highly doubt date calculation will work on mobile

    • @jube1907
      @jube1907 2 ปีที่แล้ว

      @@pdfform ok thanks

  • @umar32bright
    @umar32bright 3 ปีที่แล้ว

    Hi, I need some of your help

    • @umar32bright
      @umar32bright 3 ปีที่แล้ว +1

      @@pdfform can you help me here please?

  • @nurislam-bn7el
    @nurislam-bn7el 3 ปีที่แล้ว

    can you sent me the code?

  • @nicolewillcocks6050
    @nicolewillcocks6050 2 ปีที่แล้ว

    I have done everything you said even did a trial with your formulas and it doesn't work, I'm not sure what I am doing wrong but I have posted my formula in the reply section for you to check out.

    • @nicolewillcocks6050
      @nicolewillcocks6050 2 ปีที่แล้ว +2

      var Itemlist = this.getField("TYPE");
      if(event.willCommit)
      {
      switch(event.value){
      case "Genie-Telescopic Boom":
      Itemlist.setTYPE(["-Select Genie-Telescopic Boom", "S-45", "S-65", "S-85", "SX-125", "SX-135"]);
      break;
      case "Genie-Articulating Boom":
      Itemlist.setTYPE(["-Select Genie-Articulating Boom", "Z-45", "Z-60", "Z-80"]);
      break;

      case "Genie-Scissor":
      Itemlist.setTYPE(["-Select Genie-Scissor", "GS-2632"]);
      break;
      case "JLG-Telescopic Boom":
      Itemlist.setTYPE(["-Select JLG-Telescopic Boom", "400 Series", "600 Series", "800 Series", "Ultra Series 120-185"]);
      break;
      case "JLG-Articulating Boom":
      Itemlist.setTYPE(["-Select JLG-Articulating Boom", "400 Series", "450 Series", "600 Series", "800 Series", "Ultra Series 120-185"]);
      break;
      case "JLG-Scissor":
      Itemlist.setTYPE(["-Select JLG-Scissor", "ES Series"]);
      break;
      case "Skyjack-Telescopic Boom":
      Itemlist.setTYPE(["-Select Skyjack-Telescopic Boom", "SJ45", "SJ66", "SJ86"]);
      break;
      case "Skyjack-Articulating Boom":
      Itemlist.setTYPE(["-Select Skyjack-Articulating Boom", "SJ45", "SJ66", "SJ85"]);
      break;
      case "Skyjack-Scissor":
      Itemlist.setTYPE(["-Select Skyjack-Scissor", "SJ4726-32"]);
      break;
      default:
      Itemlist.setTYPE([""]);
      break;
      }
      }

    • @pdfform
      @pdfform  2 ปีที่แล้ว +1

      @@nicolewillcocks6050 .setTYPE should be .setItems

  • @nelsoncalabria3008
    @nelsoncalabria3008 3 ปีที่แล้ว +1

    I just copied your code:
    var Itemlist = this.getfield("Tipo");
    var Fec = this.getfield("Codigo");
    if (event.willCommit)
    {
    switch(event.value){
    case "Compra Circunstancial":
    Itemlist.setItems(["-Seleccione", "Anticipo", "Saldo", "Total"]);
    Fec.value = "";
    break;
    case "Compra Ordinaria":
    Itemlist.setItems(["-Seleccione", "Anticipo", "Saldo", "Total"]);
    Fec.value = "";
    break;
    default:
    Itemlist.setTtems([""]);
    Fec.value = "";
    break;
    }
    }
    One of the two, your code or me, is not doing the job. Any help will be appreciated.
    Thank you

    • @nelsoncalabria3008
      @nelsoncalabria3008 3 ปีที่แล้ว

      It is doing the job. It was me. Thank you so much

  • @sandipkhanapure455
    @sandipkhanapure455 2 ปีที่แล้ว

    हॅलो सर,
    आपका यह व्हिडीओ अच्छा लगा, लेकीन मुझे पीडीएफ मे डेट ऑफ बर्थ से उमर निकालनी है तो क्या करे

    • @pdfform
      @pdfform  2 ปีที่แล้ว

      @sandip khanapure. Become our patron to get the code for calculating age in pdf form