This following modification is a trick how you can set the user’s cursor automatically focus on Username textbox in Login page that generated by PHPMaker. As we know, by default, each time PHPMaker generate the Login page, user have to click on the Username textbox on that login form in order to start entering the login information. In order to make it automatically focus after PHPMaker successfully generated your login script page, then we have to modify the login.php file that located inside the template belongs to PHPMaker. This modification applied to PHPMaker version 7, as you can see from this following location of the template files.
-
Open your C:\Documents and Settings\{Your Computer Username}\My Documents\PHPMaker\Templates\phpv70.zip\Script\login.php file, and find this code:
224 225
<!--##include phpcommon.php/phpcommon-message##--> <form action="<?php echo ew_CurrentPage() ?>" method="post" onsubmit="return <!--##=sPageObj##-->.ValidateForm(this);">
then replace with this following code:
224 225 226
<!--##include phpcommon.php/phpcommon-message##--> <body onload="document.frmLogin.username.focus()"> <form name="frmLogin" action="<?php echo ew_CurrentPage() ?>" method="post" onsubmit="return <!--##=sPageObj##-->.ValidateForm(this);">
-
Still in the same file, find again this code:
265
</form>
then replace with this following code:
265 266
</form> </body>
That’s all. Now each time you have generated your .php files by using PHPMaker, then when you load the login page, the cursor will automatically focus on the Username textbox.

manteb tenan infonya bang. Nuwun for php codenya ya.