Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS /

How to change the value of the TextField?


Reply


3 Posts   358 Views

Avatar
jSimple

Community Member, 3 Posts

7 May 2014 at 5:01am

How to change the value of the field before displaying? Rate = Rate*10?????
...
private $db = array(
'Rate' => 'Text'
);

...

function getCMSFields(){
   $fields = parent::getCMSFields();

$Rate = new TextField('Rate', 'Процент, %','00','2');
      $fields->addFieldToTab('Root.Main', $Rate, 'DateFormat');

Avatar
walid

Community Member, 3 Posts

8 May 2014 at 1:07am

$myValue = $this->Rate * 10;
$Rate = new TextField('Rate', 'Процент, %', $myValue );

cheers

Avatar
jSimple

Community Member, 3 Posts

10 May 2014 at 7:22am

Hello!
It is work but does not.
I need to change the value after reading from database.

private static $db = array(
'Rate' => 'Text' <----This value
);