Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

simple expression not working

Community Beginner ,
Feb 15, 2023 Feb 15, 2023

I have 3 options for this field, either they choose "0", "5000", or "10000".  Based on that choice I need the next field to calculate the monthly rate *12 then divide by 52 to get their weekly rate.  Please help, what am I missing below?

 

var chrate=(this.getField("ChildVLife").valueAsString);
var morate=0
if(chrate=0) morate=0.0;
else if (chrate=5000) morate=1.00;
else if (chrate=10000) morate=2.00;
event.value=((morate*12)/52);

TOPICS
How to , JavaScript , PDF forms
1.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Feb 15, 2023 Feb 15, 2023

To compare values use == not only =.

E.g.: chrate==5000

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 15, 2023 Feb 15, 2023

To compare values use == not only =.

E.g.: chrate==5000

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Feb 15, 2023 Feb 15, 2023
LATEST

Thank you, worked perfectly.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines