Filename-js3.html
<html>
<head>
<script language="javascript">
function checkval(myno)
{
if(isNaN(myno.value))
{
alert("plz enter number");
myno.focus();
}
}
function val(no1,no2)
{
if(no1.value> no2.value)
{
alert("plz enter no2 is gretter then no1");
no2.focus();
}
}
function add()
{ frm.result.value=parseInt(frm.minno.value)+parseInt(frm.maxno.value);
}
</script>
</head>
<body>
<form name="frm">
Enter min no=<input type="text" name="minno" onBlur="checkval(this.form.minno)"/>
<br>
Enter max no= <input type="text" name="maxno" onBlur="checkval(this.form.maxno),add(),val(this.form.minno,this.form.maxno)" />
<br>
addtion of two no
<input type="result" name="result" readonly="readonly" onBlur=""/>
</form>
</body>
</html>
Output
Enter min no=
Enter max no=
addtion of two no
No comments:
Post a Comment