Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

Custom calculation - Multiple If Statements

$
0
0

Hi Guys

 

I'm stuck with a simple If Statement. New to JavaScript.

 

I have a "Age Field" text field, "Gender" Drop Down field and "Risk" text field.

In the "Risk" text field I need to have a Custom calculation script to find out if "Male" >= 45 or Female >= 55, +1 Risk.

 

I currently have using this:

event.value = "";

var a = +this.getField("Age").value

var b = +this.getField("Gender").value


if (a>=45 && b="Male") event.Value = "+1"

else if (a<=45 && b="Male") event.Value = "0"

if (a>=55 && b="Female") event.Value = "+1"

else if (a<=55 && b="Female") event.Value = "0"

 

Any help will be appreciated.


Viewing all articles
Browse latest Browse all 12130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>