Kamis, 04 Juni 2009

Form Validasi dengan javascript

<html>
<body>

<script language="JavaScript">

function chkuname()
{
uname=new String();
uname=document.regis.uname.value
if ( uname.length == 0 )
{
alert ("Enter a User Name");
}
else
{
chkupass()
}
}

function chkupass()
{
upass=new String();
upass=document.regis.upass.value
if (upass.length < 5)
{
alert ("Password Must be atleast 6 Chars");
}
else
{
chkname()
}
}

calculator


<html>

<head>
<title>JS - Calculator</title>

<script language="Javascript">
<!--
/* Variable */
var plussign = ' + ';
var minussign = ' - ';
var multiplysign = ' * ';
var dividesign = ' / ';
var decimalsign = ' . ';
var negativesign = ' -';
var leftbracket = ' (';
var rightbracket = ') ';
var rad = 3.141592654 / 180;