<script language="javascript" type="text/javascript">
function fnValidate() {
var ticket = document.getElementById("txtTest").value.toLowerCase();
var status = "";
var C1 = ticket.substr(0, 2);
var C2 = ticket.substr(2, 2);
var C5 = ticket.substr(4, 1)
var C6 = ticket.substr(5, 1);
var C3 = ticket.substr(6, 2);
var C4 = ticket.substr(8, 2);
if (ticket.length == 10) {
if (C1 == "10" || C1 == "11" || C1 == "12") {
if (C2 == "kp" && parseInt(C5)==1 && C6=="a") {
if (parseInt(C3) == 02 || parseInt(C3) == 04 || parseInt(C3) == 05 || parseInt(C3) == 12) {
if (C4 > 0 && C4 <= 60) {
status = "valid";
}
}
}
}
}
if (status != "") {
alert("Valid");
}
else {
alert("InValid");
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="txtTest" runat="server" Height="30px" Width="80px" MaxLength="10"></asp:TextBox><br />
<asp:Button ID="btnValidate" runat="server" Text="Vaildate" OnClientClick="fnValidate()"/>
</div>
</form>
</body>