#190206 by myself: move misplaced Javascript codes from the form definition to where the form is output