Set Form focus : Focus : Form JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Form » Focus »

 

Set Form focus

















<html>
<head>
<title>Set Form focus</title>
<script type="text/javascript" language="javascript">
<!-- //
function SetFocus(){
    document.SimpleForm.FirstInput.focus();
}

function FindMaxAndMin(){
        SetFocus();
}

// -->
</script>
</head>
<body onload="SetFocus()">
<form name="SimpleForm">
<table>
<tr>
 <td width="25%" align="right">Enter first number:</td>
 <td><input name="FirstInput" type="text"></td>
</tr>
<tr>
 <td width="25%" align="right">Enter second number:</td>
 <td><input name="SecondInput" type="text"></td>
</tr>
<tr>
 <td width="25%" align="right">Enter third number:</td>
 <td><input name="ThirdInput" type="text"></td>
</tr>
<tr>
 <td width="25%" align="right">&nbsp;</td>
 <td><button type="Button" onclick="FindMaxAndMin()">
Click to calculate</button></td>
</tr>
</table>
</form>
</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Form
» Focus