views:

17

answers:

1

Hi guys, 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

A: 

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

related questions