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 Use the NumericUpDown Control

How to show help text in page on mouse move

Get control name in Page_Load event after post back by any control