These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Basic script question

set
Registered: Feb 1 2008
Posts: 4

I have a dropdown box in my form (dp_25) with 2 choices -- 14% and 30%. I have a textbox (tbx_25) that will get it's value based on dp_25. That is, if dp_25=14%, dp_25 should "be" .14; if dp_25 is 30%, tbx_25 should be .30.

How do I do this? (I guess with jscript?)

TIA

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The value of the dropdown is a string, so all you have to do is assign dp_25 to tbx_25 with a little code for slicing the "%" off the end.

In JavaScript:

dp_25.rawValue = tbx_25.rawValue.slice(0,tbx_25.rawValue.length-1);

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

set
Registered: Feb 1 2008
Posts: 4
Thanks so much for responding,.Thomp.

I have tried that, and nothing "fills" tbx_25. tbx_25 just remains empty, no matter what I do.

As a matter of ease, I changed the dp_25 to be either .14 or .30, and changed the code to:
dp_25.rawValue = tbx_25.rawValue

Still, nothing. What could I be doing wrong, Thomp? I have made tbx_25 be a calculated field.....

TIA