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

Executing PowerShell scripts from C#

HOW TO Use the NumericUpDown Control

Exposing Agile Software Development Myths