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

* DjangoPython

Avatar of undefined
Last Comment
Ray Zuchowski

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Ray Zuchowski

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy