rewrited function for InputFields
some changes for compatibility with PHP 5.4
fixes