Reputation: 927
I have Address field in my web form.. I want to limit the characters in that textbox.. I don't know how to do this by mvc2..
My html code
<%: Html.TextBox("Address",Model.Address, new {@title="Enter your address"}) %>
If any chances in jquery is there means it will ok..
Upvotes: 0
Views: 104
Reputation: 11588
Here it is maxlength="x"
where x
: length
<%: Html.TextBox("Address",Model.Address, new {@title="Enter your address", @maxlength="10"}) %>
Or using jQuery,
$('#Address').attr('maxlength', '10');
Upvotes: 1