Don't allow space as first letter

 <script type="text/javascript">
            function CheckFirstChar(key, txt) {
                if (key == 32 && txt.value.length <= 0) {
                    return false;
                }
                else if (txt.value.length > 0) {
                    if (txt.value.charCodeAt(0) == 32) {
                        txt.value = txt.value.substring(1, txt.value.length);
                        return true;
                    }
                }
                return true;
            }
        </script>






<telerik:RadTextBox ID="txtImgname" runat="server" class="form-control" MaxLength="50" onkeyup="CheckFirstChar(event.keyCode, this);" onkeydown="return CheckFirstChar(event.keyCode, this);" placeholder="Name of Image " Width="100%"></telerik:RadTextBox>

Comments

Popular posts from this blog

Create Schema Using C# Asp .Net Dynamically.

FAQ BIND

resgination mail