next up previous contents
Next: MICinput Up: MICdo Previous: Syntax   Contents

Description

MICdo's are only valid within forms. Their purpose is to ``do'' something to each instantiation of the dynamic field specified in the name attribute. Within the MICdo, $field is made available to the coder to modify and check. MICdo's are not necessarily expected to be side effect-free with regards to other variables, but they should be nice from a maintainability/debugging standpoint.

Also available within the code block is the variable specified by numvar. Before we continue, let us look at an example:

<MICdo name="name" numvar="$index">

$val_hash{$index}-&gt;{name} = $field-&gt;value();

</MICdo>

For every field present, the group iteration index of that field will be used to key an anonymous hash. The string name will then key the value of the field name corresponding to the group iteration.

So, what do we mean by group iteration? When dynamic fields are created, the first one to be created is the first group iteration, the second the second, etc., etc.

Of course, the astute reader is now wondering what fields are present. Under MIC 2.1 and greater, the fields present are those which are needed to be displayed, those which have changed from their initial values (those fields which have had user input which is not exactly equal to the original value), those that are in error, or those that are members of a group where some field in that group meets the previous criteria.

These facts are often exploited in the use of a MICdo. For an example, see E.2.


next up previous contents
Next: MICinput Up: MICdo Previous: Syntax   Contents