freelance84 Posted August 28, 2010 Share Posted August 28, 2010 Ok, just starting out into the world of js after getting a very firm grasp of php mysql and html... and i have a question: onload="document.add.forename_1.focus()" How do i put the above into an if statement, ie, if the form "add" exists on html page then focus on field "forename_1"?? Link to comment https://forums.phpfreaks.com/topic/211929-focus-if/ Share on other sites More sharing options...
Omirion Posted August 28, 2010 Share Posted August 28, 2010 function checkForm(){ if (document.add){ document.add.forename_1.focus() } } The onload. onload="checkForm()" Link to comment https://forums.phpfreaks.com/topic/211929-focus-if/#findComment-1104555 Share on other sites More sharing options...
freelance84 Posted August 30, 2010 Author Share Posted August 30, 2010 gracias!! Link to comment https://forums.phpfreaks.com/topic/211929-focus-if/#findComment-1105210 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.