![]() |
Alexey admin 2/15/2007 |
Graeme, global $smarty; $smarty->assign("value_home_group", $value);
|
G
|
gdude66 author 2/15/2007 |
Graeme, all you need here is Add OnLoad event. Select data from the database and assign it to home group field using this code: If this doesn't work proceed to Visual Editor and inspect Home group control on Add page in HTML mode to find proper value_... name
|
G
|
gdude66 author 2/16/2007 |
The home group field is in a different table table is called student and field is called homegroup than the table this event will write to - so where and what do I put this into? My apologies - it has been 4 months since I readdressed this project and it is surprising how rusty your skills get.
|
![]() |
Alexey admin 2/16/2007 |
Graeme, |
G
|
gdude66 author 2/16/2007 |
Graeme, select a value from your database table and then use the code I provided to put this value to the field. You need to know some PHP to do this.
|
![]() |
Alexey admin 2/16/2007 |
Graeme, |
G
|
gdude66 author 2/16/2007 |
In the end I used before add events - it works well without mucking around with smarty code which I couln't get to work and I am out of time. global $conn; $strSQLExists = "select * from student where code='".$_SESSION["UserID"]."'"; $rsExists = db_query($strSQLExists,$conn); $data=db_fetch_array($rsExists); $values["class"] = $data["form group"];
|