You could attempt to conditionalize this on browser version.

On Wed, Nov 25, 2009 at 10:14 AM, Tom Evans <tevans...@googlemail.com> wrote:
> On Mon, Nov 23, 2009 at 3:57 PM, Benjamin Wohlwend <piquad...@gmail.com>
> wrote:
>>
>> Hi,
>>
>> currently, when a form in the admin has collapsed fieldsets, those
>> fieldsets are expanded on submit. As I find this rather distracting
>> and couldn't find an explanation why this should be desired behavior,
>> I suspected that this is probably a hard to find bug somewhere in
>> between CSS, HTML and Django's JavaScript code.
>>
>> When I finally took a look at the code, I was quite surprised that
>> this isn't a bug, but a feature:
>>
>> >    if (collapsed_seen) {
>> >            // Expand all collapsed fieldsets when form is submitted.
>> >
>> >  addEvent(findForm(document.getElementsByTagName('fieldset')[0]), 'submit',
>> > function() { CollapsedFieldsets.uncollapse_all(); });
>> >    }
>>
>> This code is in the admin since revision 96 [1]. But why? From a
>> technical view, both the client and the server couldn't care less if
>> the form fields are visible or not, they process them all the same.
>> Was it UI-motivated?
>
> If that was true, then you would be right. However it isn't true. Some
> browsers will not submit non hidden form elements if they are not rendered.
> Admittedly, only crap old browsers[1].
>
> Cheers
>
> Tom
>
> [1]
> http://bytes.com/topic/javascript/answers/89759-problems-form-elements-hidden-div-style-display-none
>
> --
>
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/django-users?hl=en.
>

--

You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.


Reply via email to