1

This is standard checkbox from model forms:

In my HTML I have: {{form}}

In website source:

<div class="id_accept-control-group control-group">
   <div class="controls">
      <label class="checkbox">
      <input type="checkbox" name="accept" id="id_accept" /> <span>Accept</span>
      </label>
   </div>
</div>

How to add custom attribute: disabled="disabled" checked="checked" (to input)?

1
  • Did you find the answer to your question ? Commented Jan 24, 2013 at 15:39

1 Answer 1

3

Check out this question to point you in the right direction Django: How do I add arbitrary html attributes to input fields on a form?

Also take a look at the model forms django doc https://docs.djangoproject.com/en/dev/topics/forms/modelforms/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.