form icon indicating copy to clipboard operation
form copied to clipboard

Allow numbers as valid values for radio and checkbox inputs

Open tiffwu opened this issue 8 years ago • 2 comments

Here: https://github.com/react-tools/react-form/blob/master/src/components/form-fields/Radio.js#L49

Is there a reason why only string values are permitted?

tiffwu avatar Dec 17 '17 05:12 tiffwu

I believe in html radio buttons and check boxes only accept string values (if you use an int its converted to a string).

Using React you should actually be able to store an int, or object, or anything else with a radiobox.

However if the radiobox is suppose to behave the same as its html counterpart it should only accept a string.

ro-savage avatar Jan 17 '18 11:01 ro-savage

Agree with @ro-savage. In terms of accessibility, its best not to deviate from HTML standards. Closing as I will not be changing this.

joepuzzo avatar Jan 17 '18 13:01 joepuzzo