PDF Form JavaScripts Dependent Dropdown Menus
Join our Facebook Q&A Group on PDF Form JavaScript:
/ pdfformjavascript
If this video helped you , please don't forget to SUBSCRIBE.
To get the PDF File with Script become a patron and support us :
/ 56719700
Thanks for Watching
Пікірлер: 72
FINALLY!!! Something that works!!! Thank you!!
This definitely helped. Thank you!
Amazing video!!! Super helpful!
Hi, I've followed the steps and the logic is correct, but the second dropdown menu won't appear. Why is that?
Thanks great tutorial
Could you please advise about dependent text fields? The value of one field depends on what is written on the other one?
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
Жыл бұрын
plz check our intermediate tier patreon page
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
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
2 жыл бұрын
just make a reset button
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
2 жыл бұрын
join our fb group and post ur issue in detail
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
Жыл бұрын
message on our patreon page intermediate tier
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
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"
Thank you, But I need to change only text not another dropdown list, can I do that?
@pdfform
3 жыл бұрын
Yes
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
3 жыл бұрын
@Suber Hajo Yes, it is possible
@suberhajo1135
3 жыл бұрын
@@pdfform Thank you for the answer! Wow cool! Can you send me a link or something how its done?
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
2 жыл бұрын
yes, it can be done
@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
2 жыл бұрын
@@jutilosws the script is case sensitive.. this.getfield. should be this.getField
@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
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" }
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
2 жыл бұрын
@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
2 жыл бұрын
@@pdfform Is there anyway to do it for online platform?
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
2 жыл бұрын
@@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
2 жыл бұрын
@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; } }
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
2 жыл бұрын
@Shahab Uddin. yes it is possible
@shahabuddin7346
2 жыл бұрын
@@pdfform Can you please share the script
@pdfform
2 жыл бұрын
already made a video on this topic
What is js code for this calculation: field1 + field2 + (field3 *2) + field4 Regards
@pdfform
2 жыл бұрын
@ Joe Goreta. event.value = this.getField("field1").value + this.getField ("field2").value + this.getField("field3").value *2 + this.getField("field4").value;
Is there a way to set the name=value pair so that I have the export value?
@pdfform
2 жыл бұрын
yes there is
@joannp8184
2 жыл бұрын
@@pdfform Is it a different tutorial?
@pdfform
2 жыл бұрын
join our patreon page
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
2 жыл бұрын
@dark side SUBSCRIBE to our channel and join our facebook Q&A group and post your script there.
@Kevin457_starsky
2 жыл бұрын
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
2 жыл бұрын
@@Kevin457_starsky yes. did it again and it worked. 😉
@Kevin457_starsky
2 жыл бұрын
@@BadBadUser mine just did finally!!!. Thanks @PDF Form JavaScript!
This script doesn't work in Bluebeam Revu Extreme either...
@pdfform
2 жыл бұрын
It will only work with Adobe reader
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
Жыл бұрын
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
Жыл бұрын
@@nicolewillcocks6050 .setTYPE should be .setItems
How do you do this in AEM Forms Designer?
@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..
I am trying this code in "PDF Xchanger" But, it did not work...Can you please help?
@pdfform
2 жыл бұрын
only works with adobe acrobat pro or reader
@chauhanranjeet6865
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.
can you sent me the code?
Does this work in Adobe Acrobat IOS after you created it on PC?
@pdfform
2 жыл бұрын
not all script work only selected ones
@jube1907
2 жыл бұрын
@@pdfform thanks so simple ones like calculations with date fields would work?
@pdfform
2 жыл бұрын
date calculation is not simple
@pdfform
2 жыл бұрын
@@jube1907 you need to check if it works or not. but i highly doubt date calculation will work on mobile
@jube1907
2 жыл бұрын
@@pdfform ok thanks
Hi, I need some of your help
@umar32bright
3 жыл бұрын
@@pdfform can you help me here please?
हॅलो सर, आपका यह व्हिडीओ अच्छा लगा, लेकीन मुझे पीडीएफ मे डेट ऑफ बर्थ से उमर निकालनी है तो क्या करे
@pdfform
2 жыл бұрын
@sandip khanapure. Become our patron to get the code for calculating age in pdf form
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
2 жыл бұрын
It is doing the job. It was me. Thank you so much