开发者

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


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'} ))
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜