Show number of inputing charecter in textbox.

use this script                                 
<script language="JavaScript">
                                        function textCounter(field, cntfield, maxlimit) {
                                            if (field.value.length > maxlimit) // if too long...trim it!
                                                field.value = field.value.substring(0, maxlimit);
                                            else
                                                cntfield.value = maxlimit - field.value.length;
                                        }
                                     
                                    </script>

and call like this...
 onkeyup="textCounter(this,id of textbox where you want to show,250)"
 onkeydown="textCounter(this,id of textbox where you want to show,250)"

Comments

Popular posts from this blog

How to create RSS Feed in Asp.Net

Auto generate change scripts in SQL Server Management Studio SSMS for tables

HOW TO Use the NumericUpDown Control