Adds form fields handling code