This topic is locked

Default on change page

9/24/2006 11:08:00 AM
PHPRunner General questions
S
starker author

Hi,
on an add page, I can set some defaults.
I found no way to set defaults on a change page.
I have status field, wich should be changed from ont to an other state, the actula date should be set on another field.
Do You have any idea how to do this ?
Andre

J
Jane 9/25/2006

Hi,
default values don't work on the EDIT page.

You can change field value on the EDIT page using events.

Proceed to the Events tabs, select EditOnLoad event and add your code in it.

Here is a sample code:

function BeforeEdit(&$values, $where)

{
global $smarty;

$smarty->assign("value_FieldName","new value");

return true;
}



where FieldName is your actual field name.

Please note field names are case sensitive here.