Expand my Community achievements bar.

calculation script

Avatar

Former Community Member
I am running this script to change the value of a given field upon choosing an item from a drop down list what am I doing wrong that is not making this work?:

if (form1.#subform[0].Subform1.room.order1.Rooms[1]==1, "$750.00")



if (form1.#subform[0].Subform1.room.order1.Rooms[1]==2, "$300.00")



if (form1.#subform[0].Subform1.room.order1.Rooms[1]==3, "$750.00")



if (form1.#subform[0].Subform1.room.order1.Rooms[1]==4, "$750.00")



if (form1.#subform[0].Subform1.room.order1.Rooms[1]==5, "$750.00")



if (form1.#subform[0].Subform1.room.order1.Rooms[1]==6, "$750.00")



if (form1.#subform[0].Subform1.room.order1.Rooms[1]==7, "$750.00")



if (form1.#subform[0].Subform1.room.order1.Rooms[1]==8, "$300.00")



if (form1.#subform[0].Subform1.room.order1.Rooms[1]==9, "$250.00")



if (form1.#subform[0].Subform1.room.order1.Rooms[1]==10, "$300.00")



if (form1.#subform[0].Subform1.room.order1.Rooms[1]==11, "$750.00")
1 Reply

Avatar

Former Community Member
Well, the syntax is invalid, it shouldn't be:



if (... , "$750")



it should be:



if (...) then

"$750"

endif



Also, you have characters in there that would be considered in JavaScript (ie: #) so hopefully your script is FormCalc, which is the language I used above.



Finally, the field this is in should be a text field, as a numeric field won't access a $ as part of the number. If it's a numeric field you should be setting the value to 750 and use a display patter to show a $ to the user.



Chris

Adobe Enteprise Developer Support