What is the best way to validate a textbox so that the entered text does not start with zero? Zero can be entered anywhere else in the textbox.
function checkFirst() {
var text = document.getElementById('<%=textbox.ClientID %>').value.charAt(0);
if (text == "0") {
return false;
}
}
I attempted using this code but encountered a JavaScript Runtime error. I am unsure how to resolve it.
If there are any suggestions involving regular expressions, please advise on some options.