Difference between revisions of "Allowing Only One Check Box to be Selected"
From SmartWiki
Line 14: | Line 14: | ||
The [[User|user]] will not be able to select more than a single check box with this code in place. | The [[User|user]] will not be able to select more than a single check box with this code in place. | ||
+ | |||
+ | |||
+ | ==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 Fields]][[Category:JavaScript]] | [[Category: Custom Fields]][[Category:JavaScript]] |
Revision as of 14:31, 31 March 2011
SmartSimple does not have a Select One - Radio button field type but you can use a check box field to re-create this type of functionality.
To prevent a user from selecting more than one Check Box for the associated Custom Field, add this code to the HTML Tag section of the Custom Field:
onclick="onlyonechecked(this)"
This can be used for:
- and
The user will not be able to select more than a single check box with this code in place.
Note
- If using onlyonechecked on aSelect Many - Check Box field and you also want to Show/Hide Header you should use _showhideheader instead of _showhideheadercheckbox