input maxlength field on ajax form submission causes "Uncaught SyntaxError: unexpected token u" input maxlength field on ajax form submission causes "Uncaught SyntaxError: unexpected token u" ajax ajax

input maxlength field on ajax form submission causes "Uncaught SyntaxError: unexpected token u"


This seems to be a bug in Microsoft.jQuery.Unobtrusive.Validation in combination with jQuery 1.9>

In this blog a patch of the js file is suggested

I reproduced your issue and resolved it by adding a div with the required attributes to your html to prevent an undefined being supplied to the json parse.

    <form action="#" data-ajax="true" id="form0" method="post">        <div data-valmsg-for="numberValue" data-valmsg-replace="true">deposit not valid</div>        <input id="deposit" name="numberValue" type="text"  maxlength="8" value="1000">        <input type="submit" value="go">    </form>    

There is also an Microsoft Connect issue open for this problem. Vote on that one as well to get it prioritized within Microsoft.