如何将'Required'替换为红色星号以显示该字段是必填的?
我有这些行代码的形式;fullName和presentAddress是强制性的,我在模型中声明为@Required。正如您所看到的,我隐藏了presentAddress的"Required"消息。谁能告诉我如何用红色星号替换它,而不是隐藏它?
@inputText(newStaffForm("fullName"), 'size->50, '_label -> "Full name:")
@inputText(newStaffForm("sex"), '_label -> "Sex:")
@inputText(newStaffForm("presentAddress"), '_label -> "Present Address:", '_showConstraints -> false)
可以使用'_help
参数,如下所示:
@inputText(newStaffForm("presentAddress"), '_label -> "Present Address:", '_help -> "*")
你可以用CSS给星号上色