
Next: Part 4
Up: Exercise
Previous: Part 2
Now it's time to associate the element with some code. This is done in
the Save section. Please remember that the elements appear as variables
with the same name as the element. Ie. a CheckBox with the name
pressMe will appear as a variable with the name
pressMe. See the Link to Variables sections of
Element on a configuration page
for a description on what these variables contain.
Generate the following code:
- if the checkbox labeled ``press me'' is pressed, generate ``The
checkbox is selected'', otherwise generate ``The checkbox is not
selected''. Hint: use the pick function, which takes three elements: a
truth value, a string to return if the truth value is true, and a
string to return if the value is false.
- ``The username was user name'', unless the username was
DUMMY, and code not must be generated on default values. Here
DUMMY is supposed to be the default user name, if none is given.
- generate ``The color selected is color name, which is
number color number on the list''. This must be generated to
the second file (described in part 1). Exchange the italic text with
the actual values for the Radio element.
- For all the element in the tuples in the ExtEntry, print:
``regexp = regular expression, mode = mode'', but
only for tuples, which have values in both entries. - Modify the FillOut, so username will generate @USR@, and
hostname will generate @FULLHOST@ if full host name is
selected, and @HOST@ otherwise. The whole fillout must
generate ``fillout = value''. Again you should Exchange the
italic text with the actual value.
Jesper Kjær Pedersen <blackie@imada.ou.dk>
Wed Oct 2 13:29:53 MET DST 1996