Unable to get property 'match' of undefined or null reference iam using vs2012 so i need client side script for textbox so that first value in textbox be numeric and other are alphabets RRS feed

  • Question

  • User-94139624 posted

     <script type="text/javascript">

                function Validate(event) {

                    var address = document.getElementById("address")

                    var regex = new RegExp('/^[0-9]{1}[a-zA-Z0-9]$/');

                    if (address.match(regex)) {

                        alert("address must begin with a number");

                        return false;




     <asp:TextBox runat="server" ID="txtvalid" onkeypress="return Validate(event);"></asp:TextBox>

    Monday, November 27, 2017 12:22 PM

All replies