About 3,420,000 results
Open links in new tab
  1. Django Forms: pass parameter to form - Stack Overflow

    Feb 2, 2013 · Django Forms: pass parameter to form Asked 12 years, 9 months ago Modified 4 years, 11 months ago Viewed 79k times

  2. Django Forms: if not valid, show form with error message

    Feb 1, 2013 · In Django forms, it can check whether the form is valid: if form.is_valid(): return HttpResponseRedirect('/thanks/') But I'm missing what to do if it isn't valid? How do I return the …

  3. CSS styling in Django forms - Stack Overflow

    Apr 4, 2015 · Second, note in the docs on outputting forms as HTML, Django: The Field id, is generated by prepending 'id_' to the Field name. The id attributes and tags are included in the …

  4. Django's forms.Form vs forms.ModelForm - Stack Overflow

    Aug 16, 2017 · Could anyone explain to me similarities and differences of Django's forms.Form & forms.ModelForm?

  5. What is the difference between initial data and bound data?

    49 Here's the key part from the django docs on bound and unbound forms. A Form instance is either bound to a set of data, or unbound: If it’s bound to a set of data, it’s capable of validating …

  6. How do I add a placeholder on a CharField in Django?

    q = forms.CharField(label='search', widget=forms.TextInput(attrs={'placeholder': 'Search'})) More writing, yes, but the separation allows for better abstraction of more complicated cases. You …

  7. How to insert a checkbox in a django form - Stack Overflow

    Jun 1, 2011 · class SettingsForm(forms.ModelForm): receive_newsletter = forms.BooleanField() class Meta: model = Settings And if you want to automatically set receive_newsletter to True …

  8. Align radio buttons horizontally in django forms - Stack Overflow

    May 9, 2011 · HI I want to align the radio buttons horizontally. By default django forms displays in vertical format. feature_type = forms.TypedChoiceField(choices = formfields.FeatureType, …

  9. What's the cleanest, simplest-to-get running datepicker in Django?

    84 Django's TextInput widget (and all of its subclasses) support specifying a type attribute to set the type of form. You can use this to set the input type to date (W3C specification), for …

  10. Change a Django form field to a hidden field - Stack Overflow

    I have a Django form with a RegexField, which is very similar to a normal text input field. In my view, under certain conditions I want to hide it from the user, and trying to keep the form as sim...