Forums

Events with Multiple Selections

jfascia 07 Aug, 2015
I have a Dropdown list that allows for Multiple selections:

a
b
c
d


I have an Event for this dropdown that displays a hidden text field when "c" is selected:

a
b
c
d
[text field]


The problem is when I have more than just "c" selected, the hidden text field does not display:

a
b
c
d

Is there a way to have the hidden text field display no matter what combination is selected, as long as "c" is one of those selections?

a
b
c
d
[text field]
GreyHead 08 Aug, 2015
Answer
Hi jfascia,

I don't think that the built-in event handler is clever enough to work with multiple-selection drop-downs. It would have to be done with custom JavaScript.

Bob
jfascia 10 Aug, 2015
Thanks for the response,

This is the custom function I created:
function validatePoints(element)
{
	if(element.val() != null) 
	{
		if(element.val().indexOf("C") > -1)
		{
jQuery('#form-row-textfield').show();
		}
		else 
		{
jQuery('#form-row-textfield').hide();
		}
		
	}

	return true;
}
This topic is locked and no more replies can be posted.