Fixed #17074 -- Improved first field detection in admin add form

Thanks Kidwind for the report and Julien Phalip for the initial
patch.