Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6070055
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:53:24+00:00 2026-05-23T09:53:24+00:00

I have a problem on jQuery valid function. When on IE, it doesn’t work,

  • 0

I have a problem on jQuery valid function. When on IE, it doesn’t work, the valid always return true. I used this code: client side validation with dynamically added field

Here’s the chart:

                    Chrome      IE

jquery-1.6.1        works       not working
jquery-1.4.4        works       works

1.6 doesn’t work on IE too. However, 1.4.4 jQuery valid works on IE.

Here’s the jsFiddle-friendly test (test this as local html):

<!--
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> -->

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js" type="text/javascript"></script>

<script src="http://ajax.aspnetcdn.com/ajax/jquery.validate/1.8/jquery.validate.min.js" type="text/javascript"></script>

<script src="http://ajax.aspnetcdn.com/ajax/mvc/3.0/jquery.validate.unobtrusive.min.js" type="text/javascript"></script>



<form id="XXX">
    <input type="submit" id="Save" value="Save">

</form>


<script type="text/javascript">

    // sourced from https://stackoverflow.com/questions/5965470/client-side-validation-with-dynamically-added-field
    // which I do think don't have a bug
    (function ($) {


        $.validator.unobtrusive.parseDynamicContent = function (selector) {
            //use the normal unobstrusive.parse method
            $.validator.unobtrusive.parse(selector);

            //get the relevant form
            var form = $(selector).first().closest('form');

            //get the collections of unobstrusive validators, and jquery validators
            //and compare the two
            var unobtrusiveValidation = form.data('unobtrusiveValidation');
            var validator = form.validate();

            $.each(unobtrusiveValidation.options.rules, function (elname, elrules) {
                if (validator.settings.rules[elname] == undefined) {
                    var args = {};
                    $.extend(args, elrules);
                    args.messages = unobtrusiveValidation.options.messages[elname];
                    $('[name=' + elname + ']').rules("add", args);
                } else {
                    $.each(elrules, function (rulename, data) {
                        if (validator.settings.rules[elname][rulename] == undefined) {
                            var args = {};
                            args[rulename] = data;
                            args.messages = unobtrusiveValidation.options.messages[elname][rulename];
                            $('[name=' + elname + ']').rules("add", args);
                        }
                    });
                }
            });
        }
    })($);
    // ...sourced from others


    // my code starts here...
    $(function () {

        var html = "<input data-val='true' " +
           "data-val-required='This field is required' " + "name='inputFieldName' id='inputFieldId' type='text'/>";
        $("form").append(html);

        var scope = $('#XXX');

        $.validator.unobtrusive.parseDynamicContent(scope);




        $('#Save').click(function (e) {
            e.preventDefault();
            alert(scope.valid());
        });

    });
    // ...my code ends here

</script>

UPDATE

I tried my code on jsFiddle, it has side-effect, the jQuery 1.6’s valid is working on IE. Don’t test this code on jsFiddle. Test this code on your local html

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T09:53:25+00:00Added an answer on May 23, 2026 at 9:53 am

    This problem has been solved. try version 1.8.1.

    Download jQuery validation plugin

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with this jQuery code. It doesn't work as expected: $('#select_dropdown').change
I have this jQuery code (function () { function load_page (pagename) { $.ajax({ url:
Does anybody have any idea why this doesn't work? $(document).ready(function() { var loading; var
I have this simeple jQuery code: $('#category_name').change(function() { alert('Handler for .change() called.'); var category
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have a function like this: function parseValue(value, defaultValue) { if ($.isFunction(value)) return value();
I have a problem with JQuery Toggle. I have the following code: var $_
I have this strange problem in JQuery. I try to set a value to
I have a problem with the jquery-ui dialog box . The problem is that
I have a problem in integrating PHP and JQuery: My main file is MyFile.html

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.