Expand my Community achievements bar.

Select a Item with script from DDL

Avatar

Level 7
7 Replies

Avatar

Level 8

DropDown.rawValue="DepartmentA"

Kyle

Avatar

Level 7

Thank you for your reply.

I am looking to select the Item of the DDL not the value.

Thanks

Avatar

Level 8

DropDown.editValue="DepartmentA"

Kyle

Avatar

Level 7

Let me explain :

I have a DDL_B where items are auto populate from another DDL_A.

DDL_B items: DepartmentA,  DepartmentB,  DepartmentC

Also I have 3 Numerics field : TaxA, TaxB, TaxC   and

a Total numeric field

All I need is a script to calculate the the Taxes... with the follow contition:

if (DDL_B.Item=DepartmentA)

{ TaxA.rawValue=0.5*Total.rawValue}

else if

(DDL_B.Item=DepartmentB)

{ TaxB.rawValue=0.6*Total.rawValue}

else if

(DDL_C.Item=DepartmentB)

{ TaxB.rawValue=0.9*Total.rawValue}

Where I can put also this script?

Thank you

Avatar

Level 8

if (DDL_B.editValue=="DepartmentA")

Kyle

Avatar

Level 7

What is wrong with this syntax? On calculate event

Thank you

if ( form1.Page1.StateProv.getDisplayItem=="A")

{

form1.Page1.HST.rawValue=form1.Page1.Table1.Row4.Subtotal.rawValue*0.13 ;

form1.Page1.PST.rawValue="";

form1.Page1.GST.rawValue="";

}

else if (form1.Page1.StateProv.getDisplayItem=="B")

{

form1.Page1.HST.rawValue= form1.Page1.Table1.Row4.Subtotal.rawValue*0.12;

form1.Page1.PST.rawValue="";

form1.Page1.GST.rawValue="";

}

else if (form1.Page1.StateProv.getDisplayItem=="C")

{

form1.Page1.GST.rawValue=form1.Page1.Table1.Row4.Subtotal.rawValue*0.05;

form1.Page1.PST.rawValue="";

form1.Page1.HST.rawValue="";

}

else if (form1.Page1.StateProv.getDisplayItem=="D")

{

form1.Page1.HST.rawValue=form1.Page1.Table1.Row4.Subtotal.rawValue*0.13;

form1.Page1.PST.rawValue="";

form1.Page1.GST.rawValue="";

}

Avatar

Level 8

getDisplayItem is a method that takes a parameter for the index of the item in the dropdown. Check out Designer help for more information.

Again, to get the current displayed item that the user selected use DropDown.editValue and for the value DropDown.rawValue.

Kyle