Here is my code, simplified:
<form id="form1" style="height: 759px" runat="server">
<%= Html.TextBox("txtDateFrom")%>
<input type="button" value="Add" id="btnAdd" onclick="return btnAdd_onclick()" />
</form>
I want to add a validator on client side. For example, it will control the entered text’s in the textBox length.
Important: I don’t have a model passed in that view.
If you are open to use Jquery use JQuery Validation Plugins
eg.Jquery Validation Plugin
and Position Absolute Jquery validation plugin