modified dialog to form and autoFormat and register form