The issue seems to be the name "length
" of the input, choose another name.
I guess it's a conflict with the built-in property "length" of a form.
There is a note in the jQuery-documentation: Forms and their child elements should not use input names or ids that conflict with properties of a form, such as submit, length, or method. Name conflicts can cause confusing failures.