Don't waste your time use EDFP library.
Now is very simple to display and edit ( in different ways: text , textarea, select , radio button, date , slider, checkbox, switch on/off button, map, video,...