Created
October 4, 2013 13:37
-
-
Save krutz27/6826067 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!-- jQuery: Validating an email. --> | |
| $('#txtEmail').blur(function(e) { | |
| var sEmail = $('#txtEmail').val(); | |
| if ($.trim(sEmail).length == 0) { | |
| alert('Please enter valid email address'); | |
| e.preventDefault(); | |
| } | |
| var filter = /^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z] | |
| {2,4}|[0-9]{1,3})(\]?)$/; | |
| if (filter.test(sEmail)) { | |
| alert('Valid Email'); | |
| } | |
| else { | |
| alert('Invalid Email'); | |
| e.preventDefault(); | |
| } | |
| }); | |
| <!-- HTML: Validating an email--> | |
| <asp:TextBox id="txtEmail" runat="server" /> | |
| <!-- jQuery: Limiting MaLength for TextArea --> | |
| var MaxLength = 500; | |
| $('#txtDescription').keypress(function(e) | |
| { | |
| if ($(this).val().length >= MaxLength) { | |
| e.preventDefault();} | |
| }); | |
| <!-- HTML: Limiting MaLength for TextArea--> | |
| <asp:TextBox ID="txtDescription" runat="server" | |
| TextMode="MultiLine" Columns="50" Rows="5"></asp:TextBox> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment