Quantcast
Channel: Adobe Community : Unanswered Discussions - Acrobat
Viewing all articles
Browse latest Browse all 73766

Validating text field based on 2 other fields.

$
0
0

I've tried a string of if/else but somewhere I am missiing something.

 

I've assigned variables to my fields and I will use them here.

 

vdd1 = a dropdown with 5 options, " ", "Breakfast", "Lunch" "Dinner" and "Snack"

vMad1 = A text field into which the user enters a dollar amount

 

var vdd1 = this.getField("DropDown1").value;
var vMar1 = this.getField("MealsAmountRow1").value;

 

Here is what I need in English.

 

If (vdd1 = "Breakfast") and (vMad > 25) then app.alert("NOTE: The amount you have entered exceeds the $25.00 per day breakfast limit.  Please reduce the amount to $25.00", 3)

If (vdd1 = "Lunch") and (vMad > 35) then app.alert("NOTE: The amount you have entered exceeds the $35.00 per day lunch limit.  Please reduce the amount to $35.00", 3)

If (vdd1 = "Dinner") and (vMad > 65) then app.alert("NOTE: The amount you have entered exceeds the $65.00 per day dinner limit.  Please reduce the amount to $65.00", 3)

If (vdd1 = "Snack") and (vMad > 25) then app.alert("NOTE: The amount you have entered exceeds the $25.00 per day snack limit.  Please reduce the amount to $25.00", 3)


Viewing all articles
Browse latest Browse all 73766

Trending Articles



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