Forms

<..config hyperref..>+
 \def\@Form[#1]{%
    \def\default:textarea{Form}%
    \scan:args{}#1,//\a:Form }
                                         \def\@endForm{\b:Form}
                                          \NewConfigure{Form}{2}
 \def\@TextField[#1]#2{%
    \def\default:textarea{TextField}%
    \scan:args{Field}#1,//%
    \csname a:TextField::\:textarea\endcsname  \leavevmode#2%
    \csname b:TextField::\:textarea\endcsname  }
 \def\@PushButton[#1]#2{%
    \def\default:textarea{PushButton}%
    \scan:args{}#1,value=#2,//%
    \csname a:PushButton::\:textarea\endcsname }
 \def\@Reset[#1]#2{%
    \def\default:textarea{Reset}%
    \scan:args{}#1,value=#2,//%
    \csname a:Reset::\:textarea\endcsname }
 \def\@Submit[#1]#2{%
    \def\default:textarea{Submit}%
    \scan:args{}#1,value=#2,//%
    \csname a:Submit::\:textarea\endcsname }
 \def\@CheckBox[#1]#2{%
    \def\default:textarea{CheckBox}%
    \scan:args{}#1,//%
    \csname a:CheckBox::\:textarea\endcsname
    #2\csname b:CheckBox::\:textarea\endcsname}
 \def\@ChoiceMenu[#1]#2#3{%
    \def\default:textarea{ChoiceMenu}%
    \scan:args{}#1,//%
    \csname a:ChoiceMenu::\:textarea\endcsname  \leavevmode#2%
    \csname b:ChoiceMenu::\:textarea\endcsname
    \:choices  #3,//{\csname d:ChoiceMenu::\:textarea\endcsname}%
          {\csname e:ChoiceMenu::\:textarea\endcsname}%
    \csname c:ChoiceMenu::\:textarea\endcsname }
 -_-_-

The following ‘\setkeys’ is aasumed to come from keyval.sty. Another definition is provided in xkeyval.tex.

<..hyperref utils..>+
 \def\:temp#12->#2//{\def\:temp{#2}}
 \expandafter\:temp\meaning\setkeys2->//
 \ifx\:temp\empty \else
    \pend:defII\setkeys{%
       \expandafter\ifx \csname ##1:keys\endcsname\relax
              \expandafter\def\csname ##1:keys\endcsname{##2}%
       \else  \expandafter\append:def\csname ##1:keys\endcsname{##2}%
       \fi  }
 \fi
 -_-_-

<..hyperref utils..>+
 \def\:choices#1,#2//#3#4{%
    \def\AttributeVal{#1}#3\AttributeVal#4%
    \def\:temp{#2}\ifx \:temp\empty \else
    \def\:temp{\:choices#2//{#3}{#4}}\expandafter\:temp\fi}
 \def\check:args#1=#2//{\def\:temp{#2}}
 \def\arg:quote#1=#2//{%
    \del:sp#1//%
    \expandafter\ifx \csname a:\:form:attr ::\nosp:arg\endcsname\relax
       \expandafter\ifx \csname a:::\nosp:arg\endcsname\relax
             \:warning{No configuration for \:form:attr ::\nosp:arg}%
       \else \def\AttributeVal{#2}\csname a:::\nosp:arg\endcsname
       \fi
    \else
       \def\AttributeVal{#2}\csname a:\:form:attr ::\nosp:arg\endcsname
    \fi
    }
 \def\del:sp#1#2//{\def\nosp:arg{#1#2}}
 \def\:form:attr{\ifx\:textarea\empty
    \default:textarea\else \:textarea\fi}
 \def\scan:args#1{\let\Attributes=\empty \let\:textarea=\empty
    \expandafter\ifx \csname #1:keys\endcsname\relax
       \expandafter\scan:arg
    \else  \expand:after{\expand:after
       {\expandafter\scan:arg}\csname #1:keys\endcsname,}\fi
 }
 \def\scan:arg#1,#2//{%
    \def\:temp{#1}\ifx \:temp\empty\else \ifx \:temp\space\else
       \check:args#1=//%
       \ifx \:temp\empty
          \edef\:textarea{\ifx \:textarea\empty\else ,\fi #1}%
       \else
          \arg:quote#1//%
    \fi\fi\fi
    \def\:temp{#2}\ifx \:temp\empty \else
    \def\:temp{\scan:arg#2//}\expandafter\:temp\fi
 }
 \def\check:type#1{\:Optionfalse
    \def\:temp{#1}\expandafter\check:t\:textarea,//}%
 \def\check:t#1,#2//{\def\:tempa{#1}\ifx \:temp\:tempa \:Optiontrue
    \else
        \def\:tempa{#2}\ifx\:tempa\empty\else \def\:tempa{\check:t#2//}\fi
        \expandafter\:tempa
    \fi}
 -_-_-

The \nosp:arg removes leading spaces from attribute names. Why ‘\def\del:sp#1//{\def\nosp:arg{#1}}’ doesn’t work?

\documentclass{article} 
\usepackage[tex4ht,bookmarks=false]{hyperref} 
\begin{document} 
 
 
\begin{Form}[action=mailto:foo,encoding=html,method=post] 
 
\TextField[width=7cm,name=somename,value={default value}] 
    {TextFields--input--text:  } 
 
\TextField[password,name=anymade]{TextFields--input--password: } 
 
\TextField[multiline,width=1in,height=0.6in,name=address,borderstyle=D, 
    color=1 1 1,backgroundcolor=0 0 .5, 
    value={first,second,third}]{TextFields--textarea: } 
 
 
 
\ChoiceMenu[combo,default=two,name=any, 
     ]{Choice menus--select:} 
     {one,two,three} 
 
\ChoiceMenu[default=Home,menulength=3,width=2in,name=xyz,default=two] 
     {Choice menus--select:} 
     {one,two,three} 
 
 
\ChoiceMenu[radio,default=second,name=next,borderwidth=3,bordercolor=0 1 0] 
     {Choice menus--radio:} 
     {one=first, 
      two=second, 
      and three=third} 
 
\CheckBox[]{checkbox 1} 
\CheckBox[name=namea]{checkbox 2} 
\CheckBox[name=nameb,checked]{checkbox 3} 
 
\PushButton[name=xxx,onclick={callsome.foo}]{pushbotton} 
\Submit{Submit} 
\Reset{Reset} 
 
\end{Form} 
\end{document}