Added isInputField() utility function