Asinox
Asinox

Reputation: 6865

django form and title property

i need to render my forms with the property "title" for jquery validation, how ill render my forms in this way?

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

Thanks guys

Upvotes: 4

Views: 4219

Answers (1)

Saff
Saff

Reputation: 963

Simplest way is to set this attribute manually and static like this:

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

Upvotes: 4

Related Questions