Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#15037 closed defect (fixed)

RadioButton: can't set blank ("") value

Reported by: victoryismine06 Owned by: Douglas Hays
Priority: undecided Milestone: 1.8
Component: Dijit - Form Version: 1.7.2
Keywords: Cc:
Blocked By: Blocking:


I can't seem to find a way to make a null option for Radio Buttons when trying to bind the control to a string type. It either sends 'null' as a string or 'on' if I completely remove the value.


<input name="Gender" dojotype="dijit.form.RadioButton" type="radio" value="M" />
<input name="Gender" dojotype="dijit.form.RadioButton" type="radio" value="F" />
<input name="Gender" type="radio" dojotype="dijit.form.RadioButton" checked="checked" value="" />

I'm using MVC 3, when I look at the data posting to the controller, I either see "on" or "null" as string values. I also tried value="@String.Empty" to no avail...

This works fine with just HTML without Dojo so I'm assuming its a feature or bug in the control.

Change History (3)

comment:1 Changed 10 years ago by Douglas Hays

Milestone: tbd1.8
Status: newassigned

comment:2 Changed 10 years ago by Douglas Hays

Resolution: fixed
Status: assignedclosed

In [28199]:

Fixes #15037. Change RadioButton? to allow value="" while CheckBox? still changes blank to on.

comment:3 Changed 10 years ago by bill

Summary: String Radio Button can't return nullRadioButton: can't set blank ("") value

Just updating the summary, "" is not the same thing as null.

Note: See TracTickets for help on using tickets.