Opened 11 years ago

Closed 6 years ago

#12227 closed defect (patchwelcome)

dojo.fieldToObject Not Working for Radio Button Group

Reported by: Fergus Hadley Owned by: Eugene Lazutkin
Priority: high Milestone: 1.13
Component: HTML Version: 1.5
Keywords: fieldToObject, form, radio Cc:
Blocked By: Blocking:


dojo.fieldToObject seems to have a problem with radios. In the following example, the value of the radio button group is returned as NULL no matter what is selected.

Works fine for me with all other form inputs.

I couldn't find a test page for this function so have made a test case below:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Form to Object test</title>
	djConfig="parseOnLoad: true" 
	language="javascript" type="text/javascript"></script>
<script type="text/javascript">
<link href="" rel="stylesheet" type="text/css">

<body class="tundra">
<form id="test_form"><label><input type="radio"
	checked="checked" class="noStyle" value="0" name="case_convert">none</label><br>
<label><input type="radio" class="noStyle" value="1"
<label><input type="radio" class="noStyle" value="2"
<label><input type="radio" class="noStyle" value="3"
	name="case_convert">propercase</label> <br>
<button dojoType="dijit.form.Button" type="button">Get value <script
	type="dojo/method" event="onClick" args="evt">
	    var form = dojo.byId( 'test_form' ),
			field = form[ 'case_convert' ],
			value = dojo.fieldToObject( field );

		console.log( 'Results', value, field, form );	


Change History (3)

comment:1 Changed 11 years ago by Chris Mitchell

Owner: anonymous deleted

comment:2 Changed 10 years ago by bill

Component: GeneralHTML
Owner: set to Eugene Lazutkin

comment:3 Changed 6 years ago by dylan

Milestone: tbd1.12
Resolution: patchwelcome
Status: newclosed

Given that no one has shown interest in creating a patch in the past 4+ years, I'm closing this as patchwelcome.

Note: See TracTickets for help on using tickets.