Expand my Community achievements bar.

Populating "Floating Fields" from a drop down list

Avatar

Former Community Member
I'm not sure if this is possible but here's what I have:

----- form1.#subform[0].DropDownList1::change: - (JavaScript, client) ------------------------------



var sNewSel = this.boundItem(xfa.event.newText); switch (sNewSel)

{

case "1": // Group Health Plan

FloatField1.rawValue = "inserttext\n";

form1.#subform[2].FloatField2.rawValue = "insertother text\n";

form1.#subform[2].FloatField3.rawValue = "insertothertext\n";

form1.#subform[2].FloatField4.rawValue = "insertothertext";

form1.#subform[2].FloatField5.rawValue = "insertothertext\n";

form1.#subform[2].FloatField6.rawValue = "insertothertext\n";

form1.#subform[2].FloatField7.rawValue = "insertothertext\n";

form1.#subform[2].FloatField8.rawValue = "insertothertext\n";

form1.#subform[3].FloatField9.rawValue = "insertothertext\n";

form1.#subform[3].FloatField10.rawValue = "insertothertext\n";

break;

case "2": // Group Dental Plan

TextField20.rawValue = " "

break; default: // unknown value -- do nothing

break;

}



All the insert other texts are replacing actual sensitive information. I am trying to get these to show once the "Group Health Plan" drop down is selected, but it's not doing it. Do you have any suggestions? Is it because they are floating fields??
5 Replies

Avatar

Former Community Member
I am not clear on what you are trying to do. Can you describe it in more detail.



As an aside, a floating field is used to merge data into a paragraph where you do not know the length of space that you have. Once the data is merged it is turned into static text. This is useful in letters where you have a salutation and you have a number of letters in a single data file. You would represent the salution like this:



Dear {floatingfield},



Once the data is merged on the {foatingfield} is replaced with the value in the data file and you end with:



Dear Devin J Jones,



Make sense?

Avatar

Level 2

Hi Paul,

This is exactly what I am trying to do.

Dear {floatingfield},

Once the data is merged on the {foatingfield} is replaced with the value in the data file and you end with:

Dear Devin J Jones,

How do I set up the form for this?

Thanks in advance.

KR,

Caroline

Avatar

Former Community Member
Paul,

I guess here is what I'm trying to do, I want to have it so when a user selects from the drop down that different wording populates into each floating field section ex. being if they select from the drop down list "Group Health Plan" then floating field1 on the next page shows "Mother's and Children" floating field 2 shows "contact your local representative" etc. and then if that one isn't selected that nothing shows. I am actually working off a script that someone else developed (I am trying to get THEIR form to work) without completely tearing the form apart. The above script is what they had as a change switch attached to the drop down list, but yet there's still nothing happening. Any suggestions?? Without tearing out all the floating fields and putting static hidden text? Also, this form isn't attached to a data file, it is free standing, and all the wording is built into the script.

~Devin

Avatar

Former Community Member
Floating fields cannot be used at runtime so I do not know how this was working before. To do what you are asking you woudl have to re-render the form after the selection was made so that the floating fields could be populated appropriately.



If you want to send me the form I can have a look and see what they were doing before.



livecycle8@gmail.com

Avatar

Former Community Member
Okay, I've sent it over...please let me know if you see any big errors!

~Devin