I have created a form class which is used to make forms. I can easily create forms with initial data. However, I have to write the value of the elements of my form as a label of one of my fields. To get this dynamic name, I wrote {{form.field}} as the value of the label. But since the field is a CharField, I get input elements in my form instead of a label.
I was wondering if there is any way to convert CharField to string so that I did not show my label without input element javascript?
Thanks
{{form.initial .field}} < / Code> should work, unless you need to update it in real time.
Comments
Post a Comment