Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » Django
  • » hidden widget in form still appears. [RSS Feed]

#1 Jan. 24, 2011 17:07:00

s.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

hidden widget in form still appears.


I realise i might be touching on something old here since i think i've
found a bug submission on it, but that only talks about in the
admin...


so this is my declaration of a form field...

fields = { 'xxx_venue' :
forms.CharField(widget=forms.HiddenInput(attrs={'class':'hideme','value':this_venue}),
label=""),

and used a hiddeninput to hide it, but i still get the label. so i've
hidden the label by blanking it and i still get the colon between the
empty label and the hidden input.

the class hideme that i've applied only applies to the input, not to
the label or the colon between the two.

is this actually a bug?
is this the same ashttp://code.djangoproject.com/ticket/11277?
is there an obvious way round this which doesn't involve using jquery?

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

Offline

#2 Jan. 24, 2011 17:20:36

Daniel R.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

hidden widget in form still appears.


On Monday, January 24, 2011 5:06:53 PM UTC, shofty wrote:
>
> I realise i might be touching on something old here since i think i've
> found a bug submission on it, but that only talks about in the
> admin...
>
>
> so this is my declaration of a form field...
>
> fields = { 'xxx_venue' :
> forms.CharField(widget=forms.HiddenInput(attrs={'class':'hideme','value':this_venue}),
>
>
> label=""),
>
> and used a hiddeninput to hide it, but i still get the label. so i've
> hidden the label by blanking it and i still get the colon between the
> empty label and the hidden input.
>
> the class hideme that i've applied only applies to the input, not to
> the label or the colon between the two.
>
> is this actually a bug?
> is this the same ashttp://code.djangoproject.com/ticket/11277?
> is there an obvious way round this which doesn't involve using jquery?


How are you outputting the field?
--
DR.

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

Offline

#3 Jan. 24, 2011 21:41:51

s.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

hidden widget in form still appears.


fair point.

i'd been reading somewhere about using :
{% for field in form %}
{{ field.errors }}
<p class="question">{{ field.label_tag }}:{{ field }}</
p>
{% endfor %}

to get rid of this issue.

having just swapped it back to

{{ form.as_p }}

its all working nice and cleanly. will do a little more testing.

On Jan 24, 5:20 pm, Daniel Roseman <dan...@roseman.org.uk> wrote:
> On Monday, January 24, 2011 5:06:53 PM UTC, shofty wrote:
>
> > I realise i might be touching on something old here since i think i've
> > found a bug submission on it, but that only talks about in the
> > admin...
>
> > so this is my declaration of a form field...
>
> > fields = { 'xxx_venue' :
> > forms.CharField(widget=forms.HiddenInput(attrs={'class':'hideme','value':th
> > is_venue}),
>
> > label=""),
>
> > and used a hiddeninput to hide it, but i still get the label. so i've
> > hidden the label by blanking it and i still get the colon between the
> > empty label and the hidden input.
>
> > the class hideme that i've applied only applies to the input, not to
> > the label or the colon between the two.
>
> > is this actually a bug?
> > is this the same ashttp://code.djangoproject.com/ticket/11277?
> > is there an obvious way round this which doesn't involve using jquery?
>
> How are you outputting the field?
> --
> DR.

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

Offline

  • Root
  • » Django
  • » hidden widget in form still appears. [RSS Feed]

Board footer

Moderator control

Enjoy the 21st of August
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support