Django form and ownership

I need to render my forms using the "title" property to check jquery, how rude is it to render my forms this way?

<input name="name" id="name" title="Please fill Your name!" value="" type="text" />

Thanks guys,

+3
source share
1 answer

The easiest way is to set this attribute manually and statically as follows:

class MyForm(forms.Form):
myfield = forms.CharField(widget=forms.TextInput(attrs={'title':"MYMEGATITLE","id":"MY_ID",'size':'60','maxlength':'70'} ))
+4
source

Source: https://habr.com/ru/post/1746600/


All Articles