Expand my Community achievements bar.

Help regarding Dropdown.

Avatar

Level 9

Hello All,

I have 4 Dropdown lists. Say Dropdown1,2,3,4. Each of the Dropdown contains an item called "Other". If from any of the dropdown we select "Other" then a textfield associated with it Say TextfieldOther should become mandatory.

Thanks.

Bibhu

3 Replies

Avatar

Level 6

When u select the "other" value make the textfield as user enterd required using nulltest property.

if the text field always displayed on form and needs to be mandate here is the way

//Write on any drop downlist change event

here "OtherText" is the text field object name name.

if(xfa.event.newText == "Other")

{

OtherText.validate.nullTest="error"

}

Hope this will help.

Raghu.

Avatar

Level 9

Hello Raghu,

Thanks for the reply. But I guess this script will not work. Because: If the user selects "Other" in DrowpDown1 then the Text field becomes mandatory.But after if the user selects anything except "Other" then the TextField becomes optional . My requirement is if "Other" is present in any of the 4 Dropdowns then the Textfield should become mandatory.

Thanks.

Bibhu.

Avatar

Level 9

Hi,

I made this thing work by the use of hidden fields.

Thanks.

Bibhu.