4

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

mechanical_meat
  • 163,903
  • 24
  • 228
  • 223
Asinox
  • 6,747
  • 14
  • 61
  • 89

1 Answers1

4

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'} ))
Saff
  • 913
  • 6
  • 11