TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I trying to do underlined TextField with label under the field (hyperref package).

using Underlined text field in a fillable form

i tried to renew MakeTextField:

\renewcommand{\MakeTextField}[2]{{\vbox to #2{\vfill\hbox to #1{\hrulefill}}}}

But before i can see it like underline, i had to insert this code:

\begin{insDLJS}{mydljs}{ }

So first questions are:

  1. why i see it like boxes, without javascript code?
  2. i have to insert it's for all fields? Maybe you know have to do it easler?

Then i tried to renew LayoutTextField, best try:

\vbox to \baselineskip{%
 \hbox to \DefaultWidthofText{\makebox[\width]{#2}}%
 \hbox to \DefaultWidthofText{\hfill\makebox[\width]{#1} \hfill}%



And i can't centering it, i can't get width of field and use it when i placing label. questions:

  1. How can i get size of Textfield in LayoutTextField?
  2. How centering label?

i can center it only using ugly

#2  \\%

without \renewcommand{\MakeTextField} , but it's disgusting, and create vertical spaces :(

Then i create textfield to enter date and found 2 problems:

  1. I can't insert russian text using javascript.
  2. I can't to use percent symbol (%) in javascript code in keystroke inside TextField)

First problem i solve using unicode. I wrote small python script to convert text from cp-1251 to unicode, example:

>>> unicode("Январь","cp1251")

and then insert it into javascript, and it's works :) but it's hard to read and edit this, mb smb known another way?

Second problem i solve using insDLJS (\%) without it problem with backslash (\) and (%). I'm very lazy, and maybe smb know, how i can use it inside keystroke,format,calculate, etc.?

share|improve this question

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.