Element Eval Default Value not saved in DB

indyjoel

New Member
Hi
I have an element that I have set Eval to TRUE (the plug in type is DISPLAY)
I then use this code in the default section under Eval to set the value
$user =& JFactory::getUser();
$name = $user->get('name');
return $name;

When I select add to insert data from a list the Eval default value is shown on the screen so the code is working ok.

However when I press SAVE to store the data into the DB all other data that has been entered is ok but the element eval value is not.

I have tried setting the DB default value for the element to NULL this did not work. I also set it to not be NULL but it did not work.

Not sure where to go next.
 
A display element only displays, it doesn't store in the database.

So as you have already done, use Eval in another element :)

Or... maybe just use the user element?
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top