2012年3月29日 星期四

[Flask][WTForms] 要在HTML的Select tag, 新增一個"空"的預設選項

本來想用jQuery來後製,但其實不用那麽麻煩,WTForms果然都想好了:
QuerySelectField的話,加上
allow_blank=True, blank_text=u'-- please choose --'


wtforms doc

沒有留言: