不显眼的验证:如何在将文本框内容验证为数字之前运行javascript?

时间:2013-02-21 15:45:29

标签: jquery unobtrusive-validation

我有一个由扫描仪填充的文本框,它会插入额外的空格,换行符,制表符等。我需要在激活验证之前清理它们。我的代码:

[Integer(ErrorMessage = "Survey ID must be a number.")]
public long? SurveyRecipientID { get; set; }

@Html.ValidationMessageFor(m => m.SurveyRecipientID)
@Html.LabelFor(m => m.SurveyRecipientID, "Survey ID")
@Html.TextBoxFor(m => m.SurveyRecipientID)

0 个答案:

没有答案