Changes

Jump to: navigation, search

Allowing Only One Check Box to be Selected

555 bytes added, 17:40, 22 August 2018
no edit summary
To prevent a user from selecting more than one Check Box for the associated [[SmartSimpleCustom Field]] does not support a , add this code to the '''Select One - Radio buttonHTML Tag''' type field but you can use a check box field to re-create this type section of functionality. 1. Create a the [[Custom Field|custom field]]: [[Custom Field Type (20): Select Many – Check Boxes|Select Many - Check Box]].
2. Add onclick="onlyonechecked(this following code to the '''HTML''' tag setting:)"
onclick="onlyonechecked(this)"'''NOTE: It is normally better to use a [[Combo Box]] custom field with ''Show as Radio Buttons'' selected'''  This can be used for: * [[Custom Field Type: Select Many – Check Boxes|Select Many - Check Box]] <!--*: and* [[Custom Field Type: Select Many – Scrolling Check Box|Select Many - Scrolling Check Box]] -->
3. Save the field.
The [[User|user]] will not be able to select more than a single check box with this code in place.
For a [[Custom Field Type: Select One – Combo Box|Select One - Combo Box]] field, the "Show as Radio Buttons" option can be selected to display the field selections as "radio buttons." ==Note==* If using '''onlyonechecked''' on a [[Custom Field Type: Select Many – Check Boxes|Select Many - Check Box]] field and you also want to [[Show/Hide Header]] you should use '''_showhideheader''' instead of '''_showhideheadercheckbox'''  [[Category: Custom FieldFields]][[Category:Java Script ExamplesJavaScript]]
Smartstaff, administrator
421
edits

Navigation menu