• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Drop Down Box

Drop Down Box 14 years 4 months ago #9467

  • mikebosh
  • mikebosh's Avatar
  • OFFLINE
  • Fresh Boarder
  • Posts: 6
Hi

Is it possible when selecting drop down box, multiple select, to force users to select a given number of selections say 11, no more no less

Thanks in anticipation

Mike
The administrator has disabled public write access.

Re:Drop Down Box 14 years 3 months ago #9489

  • bogdanc
  • bogdanc's Avatar
  • OFFLINE
  • Moderator
  • Posts: 669
  • Thank you received: 11
Hello,

You can try using a script similar to this one in the Form Layout tab:
<script type="text/javascript">
function limit()
{
	var dropdown = document.getElementById('check');
	var count = 0;
	for (var i=0; i<dropdown.options.length; i++)
		if (dropdown.options[i].selected)
			count++;
 
	if (count != 11)
	{
		alert('You need to select 11!');
		return false;
	}
	return true;
}
</script>

The script above will verify that exactly 11 players are selected in the multiple items list. If there are not 11 players selected then the script will return false and will not validate. You will have to change the value "check" from the script with the name of your drop-down field and also place the following code line in the additional attributes box of your submit button:
onclick="return limit();"
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!