fixed the form example to not use deprecated methods

see #822