嗨,我想做以下事情:检查文本字段是否有输入。
\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}