Dynamic TEXTAREA character limit on keyup
Hi I would like to restrict Character limit on TEXTAREA box.I am able to get char limit using Jquery if it it is one textArea.
Can you please help me limit chars for Multiple TEXTAREA in same page using jQuery Code.
- <script type="text/javascript">
- $(document).ready(function() {
- // ---- How can I do on keyup
- $('textarea').live('keyup', function() {
- ---
- });
- });
- </script>
- jQuery : <script type="text/javascript" src="./vms/vdpoams/js/jquery-1.4.2.js"></script>
JSP :
- <tr>
- <td>
- <font size="1">(Maximum : 250). You have <input readonly type="text"
- name="countdown" size="3" value="3000">
- characters left.</font>
- </td>
- </tr>
- <tr>
- <td>
- <%for(int i =0 ;i<2;i++) { %>
- <c:set var="i" value="${i+1}"/>
- <c:out value="${sessionObj.splitAttributeName}" />
- <TEXTAREA NAME="txtenglish_<c:out value="${i}"/>" COLS=35 ROWS=4 > enter English description </TEXTAREA>
- <TEXTAREA NAME="txtspanish_<c:out value="${i}"/>" COLS=35 ROWS=4 >enter Spanish description </TEXTAREA>
- <br>
- <%}%>
- </td>
- </tr>
Screen :
Thanks in advance.