-- Andrew Yager <[EMAIL PROTECTED]> wrote
(on Thursday, 11 September 2008, 09:18 PM +1000):
> On 11/09/2008, at 1:31 AM, Matthew Weier O'Phinney wrote:
> > > The value default checked values have correctly returned the value of
> > > 'enroll'. The additional checked value has returned 'notenroll'  
> > > rather
> > > than 'enroll'. The values not checked have returned '0'.
> >
> > Can you check this against current trunk? I corrected an issue with
> > dojo checkboxes late last week that may have affected this behavior
> > (for the better).
>
>
> I've just tried trunk, and have the same behaviour.
>
> Having looked again at the HTML being generated, it seems quite odd:
> <dd> <input name="courseList[CEAudio]" value="0" type="hidden"> <input  
> options="enroll notenroll" id="courseList[CEAudio]"  
> name="courseList[CEAudio]" value="notenroll" type="checkbox"> </dd>

You can't be using trunk. IDs on dijit CheckBoxes were fixed three days
ago. Please update your svn checkout and re-verify.

> Most Dojo widgits have their id's generated as (for example)  
> courseList-CEAudio ([] replaced by -), and I'm still confused as to how 
> the hidden/checkbox of the same name are supposed to function (although 
> they seem to, so I can't complain).

Basically, when a checkbox is unchecked, either no value is submitted or
an empty string is submitted for it (depending on the browser). This
causes issues on the server-side, particularly if the value is required.
The hidden element ensures a value is returned when the checkbox is
unchecked.

Within Zend_Form/Zend_Dojo, we allow you to set both the checked and
unchecked values; the unchecked value is placed in the hidden element,
the checked value in the checkbox itself. This way you get the
appropriate value back based on the status of the checkbox at
submission.

> I would value the input of any minds who understand Dojo/ZF better than I 
> :-)
>
> Andrew
>
> --
> Andrew Yager, Managing Director   (MACS BCompSc MCP)
> Real World Technology Solutions Pty Ltd
> ph: 1300 798 718 or (02) 9037 0500
> fax: (02) 9037 0591 mob: 0405 152 568
> http://www.rwts.com.au/ or http://www.stonebridgecomputing.com.au/
>

-- 
Matthew Weier O'Phinney
Software Architect       | [EMAIL PROTECTED]
Zend Framework           | http://framework.zend.com/

Reply via email to