Hello everyone,
I have a drop down field that has 16 different values(from "One" to "Sixteen"). I have a script that shows 4 fields and set mandatory for them depending on when value is returned.
IE -- One is selected only 4 fields get shown and set required...Two is selected 8 fields are shown and required...so on and so forth
When i build it for the "One" value it works fine and dandy but when i add the If/Then for the "Two" that one works but the previous "ONE" doesn't. Im baffled.
Also would there be an easier way to do this because this exit script is going to be long as all hell!
Heres my script. Check it out and Thank you.
form1.WDF.NUMLOANS::exit - (FormCalc, client)
if ($.rawValue == "One") then
form1.WDF.Table1.Row1.CLIREF1.presence = "visible"
form1.WDF.Table1.Row1.AMOUNT1.presence = "visible"
form1.WDF.Table1.Row1.LOAN1.presence = "visible"
form1.WDF.Table1.Row1.INTRATE1.presence = "visible"
form1.WDF.Table1.Row1.CLIREF1.mandatory = "error"
form1.WDF.Table1.Row1.AMOUNT1.mandatory = "error"
form1.WDF.Table1.Row1.LOAN1.mandatory = "error"
form1.WDF.Table1.Row1.INTRATE1.mandatory = "error"
else
form1.WDF.Table1.Row1.CLIREF1.presence = "invisible"
form1.WDF.Table1.Row1.AMOUNT1.presence = "invisible"
form1.WDF.Table1.Row1.LOAN1.presence = "invisible"
form1.WDF.Table1.Row1.INTRATE1.presence = "invisible"
form1.WDF.Table1.Row1.CLIREF1.mandatory = "disabled"
form1.WDF.Table1.Row1.AMOUNT1.mandatory = "disabled"
form1.WDF.Table1.Row1.LOAN1.mandatory = "disabled"
form1.WDF.Table1.Row1.INTRATE1.mandatory = "disabled"
endif
if ($.rawValue == "Two") then
form1.WDF.Table1.Row1.CLIREF1.presence = "visible"
form1.WDF.Table1.Row1.AMOUNT1.presence = "visible"
form1.WDF.Table1.Row1.LOAN1.presence = "visible"
form1.WDF.Table1.Row1.INTRATE1.presence = "visible"
form1.WDF.Table1.Row1.CLIREF1.mandatory = "error"
form1.WDF.Table1.Row1.AMOUNT1.mandatory = "error"
form1.WDF.Table1.Row1.LOAN1.mandatory = "error"
form1.WDF.Table1.Row1.INTRATE1.mandatory = "error"
form1.WDF.Table1.Row2.CLIREF2.presence = "visible"
form1.WDF.Table1.Row2.AMOUNT2.presence = "visible"
form1.WDF.Table1.Row2.LOAN2.presence = "visible"
form1.WDF.Table1.Row2.INTRATE2.presence = "visible"
form1.WDF.Table1.Row2.CLIREF2.mandatory = "error"
form1.WDF.Table1.Row2.AMOUNT2.mandatory = "error"
form1.WDF.Table1.Row2.LOAN2.mandatory = "error"
form1.WDF.Table1.Row2.INTRATE2.mandatory = "error"
else
form1.WDF.Table1.Row1.CLIREF1.presence = "invisible"
form1.WDF.Table1.Row1.AMOUNT1.presence = "invisible"
form1.WDF.Table1.Row1.LOAN1.presence = "invisible"
form1.WDF.Table1.Row1.INTRATE1.presence = "invisible"
form1.WDF.Table1.Row1.CLIREF1.mandatory = "disabled"
form1.WDF.Table1.Row1.AMOUNT1.mandatory = "disabled"
form1.WDF.Table1.Row1.LOAN1.mandatory = "disabled"
form1.WDF.Table1.Row1.INTRATE1.mandatory = "disabled"
form1.WDF.Table1.Row2.CLIREF2.presence = "invisible"
form1.WDF.Table1.Row2.AMOUNT2.presence = "invisible"
form1.WDF.Table1.Row2.LOAN2.presence = "invisible"
form1.WDF.Table1.Row2.INTRATE2.presence = "invisible"
form1.WDF.Table1.Row2.CLIREF2.mandatory = "disabled"
form1.WDF.Table1.Row2.AMOUNT2.mandatory = "disabled"
form1.WDF.Table1.Row2.LOAN2.mandatory = "disabled"
form1.WDF.Table1.Row2.INTRATE2.mandatory = "disabled"
endif
You need to use the "if ... then ... elseif ... then ...." structure to you script. This is called the "Nested if" statement. If you use JavaScirpt then you could use the 'switch()' statement.
George Kaiser