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


when submit form includes text field "maxlength" attribute using ajax, javascript error: uncaught syntaxerror: unexpected token u (jquery-1.9.1.min.js:3)

if remove maxlength attribute runs fine.

my html, stripped down page bare minimum replicate issue:

<html>     <head>         <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>         <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>          <script src="/scripts/jquery.unobtrusive-ajax.js"></script>         <script src="/scripts/jquery.validate.js"></script>         <script src="/scripts/jquery.validate.unobtrusive.js"></script>     </head>     <body>         <form action="#" data-ajax="true" id="form0" method="post">              <input id="deposit" name="numbervalue" type="text" class="despositinput" maxlength="8" value="1000">              <input type="submit" value="go">         </form>         </body> </html> 

can't work out i'm doing wrong - perhaps jquery scripts provided template visual studio incompatible? i'd appreciate help, thanks.

this seems bug in microsoft.jquery.unobtrusive.validation in combination jquery 1.9>

in blog patch of js file suggested

i reproduced issue , resolved adding div required attributes html prevent undefined being supplied 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 microsoft connect issue open problem. vote on 1 prioritized within microsoft.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

.htaccess - Matching full URL in RewriteCond -