# Generating unique names in textfield

I am wrinting a LaTeX document and I'd like it to be editable in Acrobat. I'm using Textfield provided by eforms.

This document is a longtable with a description and two cells the user needs to fill with text. I have about 300 lines and I can't imagine I need to create a name for each texffield I have (line * number of cells).

If I let the name empty, or if the name is the same for 2 textfields, then Acrobat Reader bugs so I wanted to concatenate eg rownumber and columnumber but I don't know how to retrieve the last one.

Is there any way to do it ?

Here is a MWE :

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{longtable}
\usepackage[pdftex]{eforms}

\begin{document}
\section{}

\begin{longtable}{|p{12cm}|p{1.2cm}|p{1.2cm}|}
\hline
\sc text here & \sc form1 & \sc form2 \\
\hline

text here & \TextField[{maxlen=2,align=0,borderwidth=1,height=8pt,width=1cm,name=}]{} & \TextField[{maxlen=2,align=0,borderwidth=1,height=8pt,width=1cm,name=}]{} \\
\hline

\end{longtable}
\end{document}


Please check if this helps. Here the roman numerals are used to name the fields (not actually checked for 300 lines).

\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{longtable}
\usepackage[pdftex]{eforms}

\makeatletter
\newcount\fldn@me\fldn@me=1
%
\def\TextFieldX{%
\xdef\textFldName{name=\romannumeral\fldn@me}
\expandafter\TextField\expandafter[\expandafter{\textFldName,maxlen=2,align=0,borderwidth=1,height=8pt,width=1cm}]{}%
}
\makeatother

\begin{document}
\section{Section A}
\begin{longtable}{|p{12cm}|p{1.2cm}|p{1.2cm}|}
\hline
\sc text here & \sc form1 & \sc form2 \\
\hline
text here & \TextFieldX  & \TextFieldX \\
text here & \TextFieldX  & \TextFieldX \\
text here & \TextFieldX  & \TextFieldX \\
text here & \TextFieldX  & \TextFieldX \\
text here & \TextFieldX  & \TextFieldX \\
text here & \TextFieldX  & \TextFieldX \\
\hline
\end{longtable}

\section{Section B}
\begin{longtable}{|p{12cm}|p{1.2cm}|p{1.2cm}|}
\hline
\sc text here & \sc form1 & \sc form2 \\
\hline