Fix sample code
bug #3551 [Cookbook][Dynamic Form Modification] Fix sample code (rybakit)

This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #3551).

Discussion
----------

[Cookbook][Dynamic Form Modification] Fix sample code

Commits
-------

0497b38 [Cookbook][Dynamic Form Modification] Fix sample code