This topic is locked

UPDATE A FIELD

1/21/2011 3:59:53 PM
PHPRunner General questions
T
thefoxes author

Hi there
New to PHP ...so really sorry
I have a field that is populated with a list box .... the field is call "status"
What i want to do is..... if one of the values is selected from this listbox called "Returned" it will update another field with the current date (now())
many thanks

Sergey Kornilov admin 1/21/2011

This can be placed to BeforeAdd event:

if ($values["status"]=="Returned")

$values["AnotherField"]=now();


Replace AnotherField with datetime field name.

T
thefoxes author 1/21/2011



This can be placed to BeforeAdd event:

if ($values["status"]=="Returned")

$values["AnotherField"]=now();


Replace AnotherField with datetime field name.


Hi Sergey
if ($values["Status"]=="Returned") $values["Returned date"]=now();
I have placed the above code in beforeadd event (of the items table), however it does not seem to update the field of "Returned date" with the current date... I am i doing something wrong

A
asawyer13DevClub member 1/21/2011



Hi Sergey
if ($values["Status"]=="Returned") $values["Returned date"]=now();
I have placed the above code in beforeadd event (of the items table), however it does not seem to update the field of "Returned date" with the current date... I am i doing something wrong


Not sure if this is the issue, but is it possible to change the field name so it doesn't have the space in it and then try the update?
Alan

Sergey Kornilov admin 1/21/2011

Make sure all field names are correct (case sensitive, no extra spaces etc).
If this doesn't help post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

T
thefoxes author 1/21/2011



Not sure if this is the issue, but is it possible to change the field name so it doesn't have the space in it and then try the update?
Thanks Alan

Changed the field name, but still getting the date entered into the other field. Do I after use a "then" statement or am i missed a brackets?
thanks...a little puzzled
Alan