Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: MVC jQuery
i have a textbox as follows:
@Html.Label("lblName", "Name")<br />
<n style="display: none; font-weight: bold;">Only alphabets allowed</n>
and i have applied the jquery to it as follows:
    $(document).ready(function () {
        $("#txtName").change(function () {
            var regex = /^[a-zA-Z]*$/;
            var Name= $("#txtName").val();
            if (!regex.test(Name)) {
                $('n').css('color', 'red');
                $('#txtName').css("border", "solid 1px red");
            else {
                $('#txtName').css("border", "solid 1px #BBBBBB");
The above code works perfectly fine in Firefox and Google Chrome, but not in IE...
Is there anything that i must add to solve this issue???
Please help me
Posted 30-Apr-13 20:56pm
Edited 30-Apr-13 21:11pm
Brian A Stephens at 1-May-13 8:41am
I tried this code in IE, and it works. Can you post the code to jsFiddle, as it was rendered by MVC? I didn't use MVC; I entered the <label> and <input> tags manually. Also, what version of IE were you trying?
Prasad Khandekar at 2-May-13 11:06am
IE 8 abd below do not support custom tags. For IE 8 & belwo change the tag to <span>

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 9,535
1 OriginalGriff 8,295
2 Peter Leow 4,839
3 Kornfeld Eliyahu Peter 3,210
4 Maciej Los 2,301

Advertise | Privacy | Mobile
Web02 | 2.8.150327.1 | Last Updated 1 May 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100