c# - MaxLength="255" property does not seem to be working? -


this question has answer here:

i have textbox field maxlength set 255. can enter more 255 characters in textbox. expecting there 255 character limit.is there way control this? need use code behind? can control requiredfieldvalidator?

here code in .aspx

 <asp:textbox id="txtcommentaire" runat="server" width="600px" maxlength="255" textmode="multiline"   height="90px" style="overflow:hidden" ></asp:textbox> 

maxlength doesn't apply when have textmode="multiline".

when use <asp:textbox textmode="multiline">, <textarea> rendered page. textarea tags didn't support maxlength attribute until (html5). therefore, when feature designed, microsoft ignored maxlength attribute in multiline mode.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -