base functionality for form