We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

How to change form element value?

given this code:

$form->get('a')->getValue(); // return 1
$form->get('a')->getValue(); // return 1, instead of 2

the last line returns an unexpected result, it still returns 1 instead of 2. setValue() doesnt even exists.

edited May '16

on your controller:

    $this->tag->setDefault("yourInputID", "yourvalue");