If you're new here, you may want to subscribe to my RSS feed. So that you can read the latest updates about Web2.0 tools, Making Money Online, Tips in SEO, Ajax and many more. Thanks for visiting ProgramimiCOM!
The focus method is handy when error checking forms. All it does is put the cursor in the given element, which although simple, can be quite handy for the user. Using focus is really simple:
<script type=‘text/javascript’>
function error_check()
{
if(document.myform.myfield.value == ‘’)
{
alert(“Please fill in all fields!”);
document.myform.myfield.focus();
return;
}
else
{
//sucess, what to do. . .
}
}</script>
Useful and simple, a very good combination. Focus is a pretty simple function, but it adds to the user experience, which is always good.
Print This Post
Email This Post
Comments RSS
TrackBack Identifier URI
You must be logged in to post a comment.