Posts

Showing posts from January, 2012

javascript Div pop up

<style type="text/css">     #popup      {         background-color:#111;         opacity: 0.65;         filter:alpha(opacity=65);         position:absolute;         z-index: 6001;         top:0px;         left:0px;         width:100%;      }     #popUpDiv      {         position:absolute;         background-color:#eeeeee;         width:300px;         height:300px;         z-index: 6002;     }    </style> <script type="text/javascript">  ...

how to limit the number of characters in textarea

<script language="javascript" type="text/javascript"> function limitText(limitField, limitCount, limitNum) {     if (limitField.value.length > limitNum) {         limitField.value = limitField.value.substring(0, limitNum);         alert("your message exceeds the limit");     } else {         limitCount.value = limitNum - limitField.value.length;     } } </script> <form name="myform" action=""> <textarea id="t1" name="description" onpropertychange="limitText(this.form.description,this.form.countdown,10);"  OnInput="limitText(this.form.description,this.form.countdown,10);" onKeyDown="limitText(this.form.description,this.form.countdown,10);" rows="20" cols="40"> </textarea><br> <font size="1">(Maximum characters: 10)<br> You have <input readonly type="text" name="countdown...