Changes

Jump to navigation Jump to search
665 bytes added ,  10:26, 31 March 2015
moved some elements to enhance structure, added explanations
< [[Visuals]] | [[Interaction]] >
You can find more about interactive form elements in [http://www.pragma-ade.com/general/manuals/mwidget-s.pdf Widgets uncovered]. It’s written for MkII, but still mostly valid.
At the moment all of the following examples are from <tt>mwidget</tt> manual. We will cook up our own later.
For PDF is only an interface, you need =JavaScript to handle interaction (field input etc.).=
=If you need to check or otherwise process the input of your forms, you need JavaScript=to handle interaction. For simple forms without input validation, you can skip this section.
<texcode>
{{Explanation}}
==Text Entries== seeRelevant commands:
* {{cmd|setupfield}}, {{cmd|setupfields}}
* {{cmd|definefield|[name][type][setup name][content values][default content]}}* {{cmd|field|[name]}}
* {{cmd|fillinfield}}
* {{cmd|fillinline}}
* {{cmd|fillintext}}
* {{cmd|fillinrules}}
 
Field types:
* line: one line of text
* text: more lines of text
* radio: radiobutton (only one of a group can be active)
* check: checkbox
Beware, for fillinfields in MkIV you need {{code|\usemodule[fields]}}!
They’re meant for clozes (texts with gaps, like in questionnaires).
 
Other fields you must first define and then use. That might look complicated, but you can use the same field several times, and the contents will automatically repeat themselves if you need the same content at several places, even on different pages.
 
==Text Entries==
<texcode>
\fillinfield[name]{text that defines field length}
% or
\definefield [Email] [line] [ShortLine] [] [sample@contextgarden.net]
\field [Email] [your email]
</texcode>
{{cmd|definefield|[name][type][setup name][content values][default content]}}or
{{cmd|<context source=yes>\setupfield[ShortLine][horizontal][width=2cm]\definefield [Email] [line] [ShortLine] [] [sample@contextgarden.net]\field|[nameEmail] [your email]}}</context>
==Radiobuttons==
background=screen]
\definefield[Logos] [radio] [LogoSetup][ConTeXt,PPCHTEX,TeXUtil] [PPCHTEX]
\definesubfield [ConTeXt] [] [ConTeXtLogo]

Navigation menu