How to build the form with template?