some boilerplate form event code