Delphi For PHP Forums       


Go Back   Delphi-PHP Forums > Delphi For PHP > VCL4PHP
Forum Jump Register FAQ Members List Downloads Search Today's Posts Mark Forums Read

VCL4PHP VCL for PHP. Questions or comments about the Visual Component Library for PHP, post them here!

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 19th June 2009, 12:36
D4PHP User
 
Join Date: Jan 2009
Posts: 13
mk_common is on a distinguished road
Default set focus to first textbox

<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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 19th June 2009, 13:38
405hp's Avatar
Firebug Fanatic
 
Join Date: Dec 2007
Location: State of Confusion
Posts: 3,216
405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute
Default

you just put the code into the forms js onload event
Code:
findObj("firstName").focus();
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 24th June 2009, 17:02
D4PHP User
 
Join Date: Jan 2009
Posts: 13
mk_common is on a distinguished road
Default where i can learn more about delphi for php

where i can learn more about delphi for php

is there any book OR video or Source files to learn

warm regards,
mk.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 25th June 2009, 04:30
405hp's Avatar
Firebug Fanatic
 
Join Date: Dec 2007
Location: State of Confusion
Posts: 3,216
405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 26th June 2009, 12:53
D4PHP User
 
Join Date: Jan 2009
Posts: 13
mk_common is on a distinguished road
Default findObj("firstName").focus();

name of my textbox is dpcust5

findObj("dpcust5").focus();
this is not focus to my any textbox

warm regards,
mk.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 26th June 2009, 13:36
405hp's Avatar
Firebug Fanatic
 
Join Date: Dec 2007
Location: State of Confusion
Posts: 3,216
405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute
Default

Are you using standard edit or textfield/labeled edit? Textfield uses .setFocus()

Use firebug in firefox and see if there are errors stopping it and/or set a break point and see that your code is actually running.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 27th June 2009, 15:37
D4PHP User
 
Join Date: Jan 2009
Posts: 13
mk_common is on a distinguished road
Default my code

<?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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 28th June 2009, 03:59
405hp's Avatar
Firebug Fanatic
 
Join Date: Dec 2007
Location: State of Confusion
Posts: 3,216
405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute405hp has a reputation beyond repute
Default

Quote:
Originally Posted by mk_common View Post
findobj("$this->fdcust5").Focus();
$this->fdcust5 is php not javascript.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 28th June 2009, 10:03
D4PHP User
 
Join Date: Jan 2009
Posts: 13
mk_common is on a distinguished road
Default is this code perfect

<?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.
Attached Files
File Type: zip unit13.zip (1.3 KB, 9 views)

Last edited by mk_common; 28th June 2009 at 10:44.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 28th June 2009, 11:28
D4PHP User
 
Join Date: Jan 2009
Posts: 13
mk_common is on a distinguished road
Default please post a sample

if possible please post a sample

warm regards,
mk.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +1. The time now is 03:35.




Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0 ©2009, Crawlability, Inc.
Copyright © 2004 - 2009, G&J Solutions Ltd. All Rights Reserved. terms of use