Link to home
Start Free TrialLog in
Avatar of Ray Zuchowski
Ray Zuchowski

asked on

Make Field Readonly

I have a field in my database that is displayed on my form in Django that i want to be just readonly. How do i do that ?


Here is my a section of my HTML page.

{% extends 'base.html' %}

{% load crispy_forms_tags %}
{% load static %}
{% block content %}

<br>
<h2>{% load static %}
<img src="{% static 'forms/star.png' %}" alt="chain" height="62" width= "62">  K-8 School Points</h2>
<br>
<br>
<div class = "container">
 <div class= 'row'>
  <div class="col-4"> 
<p> Recording Data as User : {{user.username}} </p>
  </div>
</div>

 <div class= 'row'>
  <div class="col-2"> 
<p>{{form.status|as_crispy_field }}</p>                                <------------This is the field i need to be readonly 
  </div>
</div>
<form method="POST">
    {% csrf_token %}
 <!-- Start Date -->

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Ray Zuchowski
Ray Zuchowski

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial