Expand my Community achievements bar.

SOLVED

Trying to Numeric Field by Text Field

Avatar

Former Community Member

I am trying to figure out how to have a livecycle form divide NumericField1 by rf1 and have the answer placed in qf1.  I am not sure what to do.  Any help would be appreciated.

1 Accepted Solution

Avatar

Correct answer by
Level 10

The mistake I did earlier code is missing rawValue on rf1.

      qf1.rawValue = NumericField1.rawValue / parseInt(rf1.rawValue);

Sample file is below..

https://acrobat.com/#d=-H2armoLcjcpXLvWwO-Drw

Thanks

Srini

View solution in original post

4 Replies

Avatar

Level 10

If I understand correctly, you want to devide a value in Numericfield and display the output in an other field.

   qf1.rawValue = NumericField1.rawValue / parseInt(rf1);

Place the code in the exit event (or) Calculate event of NumericField1/ rf1.

Set the language to Java Script.

Thanks

Srini

Avatar

Former Community Member

Thanks for the help, but that did not work.  Let me clarify.  What I am building is an equipment request form that auto populates and auto calculates based upon the number of students in a class. 

The person filling the form out enters in NumberField1 that they have "24" students.

The person filling the form out would select for example "ACLS"  In text field 1 (tf1) the word "CPR Manikin" would appear.  Then in ratio field 1 (rf1) the number "3" would enter in automatically. 

What I need to happen is the number of students (NumberField1) is divided by the ratio field 1 (rf1) and the solution be placed in quantityField 1 (qf1).

Does that make more sense?

Thanks!

Avatar

Correct answer by
Level 10

The mistake I did earlier code is missing rawValue on rf1.

      qf1.rawValue = NumericField1.rawValue / parseInt(rf1.rawValue);

Sample file is below..

https://acrobat.com/#d=-H2armoLcjcpXLvWwO-Drw

Thanks

Srini