I\'m trying to pass the entered text to the controller using an ajax request. But i\'m getting athe error \"Uncaught TypeError: Cannot set property \'value\' of null \" whe
You don't have an element with the id u.That's why the error occurs.
Note that the global variable document.getElementById("u").value means you are trying to get the value of input element with name u and its not defined in your code.