![从文本字段环境之外的文本字段获取输入](https://linux22.com/image/459575/%E4%BB%8E%E6%96%87%E6%9C%AC%E5%AD%97%E6%AE%B5%E7%8E%AF%E5%A2%83%E4%B9%8B%E5%A4%96%E7%9A%84%E6%96%87%E6%9C%AC%E5%AD%97%E6%AE%B5%E8%8E%B7%E5%8F%96%E8%BE%93%E5%85%A5.png)
嗨,我想做以下事情:检查文本字段是否有输入。
\documentclass[a4paper,12pt, hidelinks]{scrreprt}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage[margin=1.5cm]{geometry}
\usepackage{tabularx}
\usepackage{makecell,
tabularx}
\setcellgapes{3pt}
\usepackage{enumitem}
\usepackage{hyperref}
\usepackage[official]{eurosym}
\usepackage{booktabs}
\usepackage{etoolbox}
%\begin{document}
%\documentclass{article}
\usepackage{xintexpr}
\begin{document}
\begin{Form}
\TextField[width=5cm,name= test]{}\\
\TextField[width=5cm,name= testt]{}\\
%event.value=this.getField('test').value
\def\mymacroA{getField('test').value}
\def\mymacroB{}
\def\mymacroC{E}
\def\mymacroD{ E }
\ifdefempty{\mymacroA}{YES}{NO}\par
\ifdefempty{\mymacroB}{YES}{NO}\par
\ifdefempty{\mymacroC}{YES}{NO}\par
\ifdefempty{\mymacroD}{YES}{NO}
\end{Form}
% \pdfstrcmp {text1}{text2} evaluates to 0 if text1 and text2 are equal
% to -1 if text1 comes first in lexicographic order, to +1 else
% To test if the strings are equal we thus use not(\pdfstrcmp {text1}{text2})
% (or we can use the ! as synonym of the "not" function)
\end{document}