javascript
js控制 html.textboxfor,javascript - Html.TextBoxFor regex is not working - Stack Overflow
I have two helpers: Html.TextBox and Html.TextBoxFor
Html.TextBox(someId, someValue, new { @class = "text-box single-line numericPropertyValue", regexp=@"^(-?\d{0,9}([.]\d{0,5})?)?$", minValue = someMinValue, maxValue = someMaxValue, invalidValueMessage = ValidationMessages.ValueIsIncorrect(), invalidRangeMessage = ValidationMessages.InvalidRangeMessage(someMinValue, someMaxValue) })
This one specifies Budget and allows me to input only digits.digits and works fine.
Another one is Html.TextBoxFor:
Html.TextBoxFor(x => x.some.Name, new { @class = "text-box single-line numericPropertyValue", regExp = @"^[a-zA-Z0-9]", invalidValueMessage = "value is invalid" })
This one specifies Name for some item, never mind. But my regex is not working. However, if I put there regex from the first Html.TextBox, it is still not working and allows me to enter everything.
Do u know what is wrong with my TextBoxFor?
Thanks a lot.
總結(jié)
以上是生活随笔為你收集整理的js控制 html.textboxfor,javascript - Html.TextBoxFor regex is not working - Stack Overflow的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 如何选购CPU散热器怎么买cpu散热器
- 下一篇: 腋下有臭味(腋下特别臭)