I have a form with 2 input fields email and password(hidden) . I’m trying to generate a random value as below but failed to bind password(hidden) value after submit.
$password = substr(md5(rand(100000, 999999)), 0, 6);
$this->form->bind($request->setParameter('password',$password));
Form has the setNameformat with:
$this->widgetSchema->setNameFormat('user[%s]');
If a doctrine (or propel) form, I would do this by setting the values on the object before passing to the form constructor, and completely removing the widget from the form.
eg:
Then display/save the form as usual – the password value will be passed right through the form process to the database when saved.