Click here to Skip to main content
13,049,263 members (68,102 online)
Rate this:
Please Sign up or sign in to vote.
See more:
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 19:56pm
Updated 30-Apr-13 20:11pm
Brian A Stephens 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 2-May-13 11:06am
IE 8 abd below do not support custom tags. For IE 8 & belwo change the <n> 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 1 May 2013
Copyright © CodeProject, 1999-2017
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