Question : Livecycle Designer need help with Java Script multiplication.

I am new to Java Script. I have a Livecyle Designer form and I am trying to multiply NumericField1 by 4% and display the result in NumericField2. This seems easy, but can't get it to work. Also where do I put this is the script editor?

Thanks in advance.

Answer : Livecycle Designer need help with Java Script multiplication.

To multiply NumericField1 by 4%, you probably have to convert the (presumably string) value to a number before you do the multiplication

  parseFloat( NumericField1 ) * 0.04

You may want to specify a fixed number of fields after the decimal point using something like:

  ( parseFloat( NumericField1 ) * 0.04 ).toFixed( 2 )
Random Solutions  
 
programming4us programming4us