Forum Moderators: phranque

Message Too Old, No Replies

Form Fields (Radio Buttons with maximum number selection)

         

sandpetra

10:17 am on Jan 4, 2006 (gmt 0)

10+ Year Member



I want to make a form field of a collection of radio buttons - say 10 - of which a user can select only 4.

Can someone help?

Would I need to use javascript?

sonjay

1:31 pm on Jan 4, 2006 (gmt 0)

10+ Year Member



You probably really want checkboxes, not radio buttons. Radio buttons are normally used for a set of options from which the user is allowed to select exactly one. Checkboxes are used for allowing multiple selections.

You can do it client-side with javascript or server-side with the scripting language of your choice. Or both.

Doing it client-side with javascript doesn't work if the user has javascript disabled, of course, so either server-side or both is the better option if the restriction really matters.