Wednesday 17 October 2012

Align Text in vertical using css

<html>
<head>
<title>
</title>
<style type="text/css" >
.Vertical
{
 
webkit-transform: rotate(-90deg);    
-moz-transform: rotate(-90deg);    
-o-transform: rotate(270deg);
writing-mode: tb-rl;
filter: fliph() flipv();    
font-weight:bold;    
font-family:Verdana;    
font-size:12px;

}
</style>
</head>
<body>
<table border="1" >
<tr>
<td class="Vertical">
English
</td>
<td class="Vertical">
Tamil
</td>
<td class="Vertical">
Maths
</td>
<td class="Vertical">
Science
</td>
<td class="Vertical">
social
</td>
</tr>
<tr>
<td >
95
</td>
<td >
85
</td>
<td >
64
</td>
<td >
88
</td>
<td >
76
</td>
</tr>
</table>
</body>
</html>

Tuesday 16 October 2012

Text Area Validation for maximum length in java script and asp.net


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TextAreaValidation.aspx.cs"Inherits="TextAreaValidation" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<head runat="server">
    <title></title>
    <script type="text/javascript">

        function TextAreaValidation(field, count, max)
        {
            if (field.value.length > max)
             {
                field.value = field.value.substring(0, max);
                field.blur();
                field.focus();
                return false;
            }
            else
            count.value = max - field.value.length;
           
        }
   </script>
  
</head>
<body>
    <form id="form1" runat="server">

<asp:TextBox runat="server" onblur="TextAreaValidation(this,this.form.counter,500);"
        onkeyup="TextAreaValidation(this,this.form.counter,500);"
        style="width: 352px; height: 74px" rows="5" cols="10" id="txtArea" TextMode="MultiLine" ></asp:TextBox>
<br />
Maximum Character<input type="text" onblur="TextAreaValidation(this.form.recipients,this,500);" disabled="disabled" onfocus="this.blur();"   value="500" name="counter" />
</form>
</body>
</html>