![]() |
|
|
|||||||
| VCL4PHP VCL for PHP. Questions or comments about the Visual Component Library for PHP, post them here! |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
<html>
<script type="text/javascript"> function setfocus() { document.GetElementById("firstName").focus(); } </script> <body onload="setfocus()"> </body> </html> how i can do above in delphi for php how i can set focus to first text box when i run a delphi for php project in browser. warm regards, mk. |
| Sponsored Links |
|
|
|
||||
|
It is all just php, javascript and html. There are a lot of resources on the web for those. For the specifics on how d4php/vcl wraps those together, read the second post here
General question on Delphi for PHP |
|
|||
|
<?php
require_once("vcl/vcl.inc.php"); //Includes use_unit("db.inc.php"); use_unit("dbtables.inc.php"); use_unit("comctrls.inc.php"); use_unit("forms.inc.php"); use_unit("extctrls.inc.php"); use_unit("stdctrls.inc.php"); //Class definition class Unit13 extends Page { public $dscust1 = null; public $dbtest1 = null; public $tbcust1 = null; public $Panel1 = null; public $fdcust5 = null; public $fdcust8 = null; public $fdcust7 = null; public $fdcust6 = null; public $fdcust4 = null; public $fdcust3 = null; public $fdcust2 = null; public $fdcust1 = null; function Unit13JSLoad($sender, $params) { ?> //Add your javascript code here // error on below line findobj("$this->fdcust5").Focus(); <?php } } global $application; global $Unit13; //Creates the form $Unit13=new Unit13($application); //Read from resource file $Unit13->loadResource(__FILE__); //Shows the form $Unit13->show(); ?> warm regards, mk. Last edited by mk_common; 27th June 2009 at 15:40. |
|
|||
|
<?php
require_once("vcl/vcl.inc.php"); //Includes use_unit("db.inc.php"); use_unit("dbtables.inc.php"); use_unit("comctrls.inc.php"); use_unit("forms.inc.php"); use_unit("extctrls.inc.php"); use_unit("stdctrls.inc.php"); //Class definition class Unit13 extends Page { public $dscust1 = null; public $dbtest1 = null; public $tbcust1 = null; public $Panel1 = null; public $fdcust5 = null; public $fdcust8 = null; public $fdcust7 = null; public $fdcust6 = null; public $fdcust4 = null; public $fdcust3 = null; public $fdcust2 = null; public $fdcust1 = null; function Unit13JSLoad($sender, $params) { ?> //Add your javascript code here // error on below line // is this ok findobj("fdcust5").Focus(); <?php } } global $application; global $Unit13; //Creates the form $Unit13=new Unit13($application); //Read from resource file $Unit13->loadResource(__FILE__); //Shows the form $Unit13->show(); ?> warm regards, mk. Last edited by mk_common; 28th June 2009 at 10:44. |