Skip to content

Conversation

@Nivl
Copy link

@Nivl Nivl commented Nov 24, 2013

Currently hidden fields have their label displayed. This pull request will only display the field and not the label of an hidden element.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace this line with "isinstance(field.field.widget, forms.HiddenInput)" if #38 is merged.

@tzangms
Copy link
Owner

tzangms commented Dec 5, 2013

@Nivl which version of Django are you using?

@Nivl
Copy link
Author

Nivl commented Dec 5, 2013

@tzangms 1.6 Why? There's something wrong with the code?

@tzangms
Copy link
Owner

tzangms commented Dec 5, 2013

@Nivl

Nope, I just try to add a hidden field with this line below, but I didn't see any label appear

hidden_field = forms.CharField(widget=forms.HiddenInput)

is something like this?

@Nivl
Copy link
Author

Nivl commented Dec 5, 2013

Actually I only had the issue using modelformset_factory (sorry, I should have made that clear). Django is adding the pk field in the form as an hidden input, but for an unknown reason it displays the label.

@tzangms
Copy link
Owner

tzangms commented Dec 5, 2013

Got it, I will test that, and I should improve the example project for testing modelformset_factory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants