Friday, June 8, 2007

Using html and computed for display-fields for temporary values


Date: <input name="dateChanged" type="text" /><br />
Changed by: <input name="changedBy" type="text"><br />
Description of change:<br />
<textarea name="description" rows="5" cols="40"></textarea>


Hidden fields on the form:

<!--
Computed for display - default value/name=name of html-field
-->



<!-- Computed -->



Example code for the historyChange:

change:=dateChanged+", "+changedBy+": "+description;
@If(change="";
historyChange;
historyChange:change
);


This code concatenates the field-values to a string, and adds the string as a text-list item in the historyChange-field.

In the form that I use this method, I have a date-picker on the date-field ( and the field is readonly ), and the value is a computed text, @Text(@Today).

Other uses is for instance a checkbox that controls what happens to a document when it's saved, but has no other real purpose. The values in this example can be accessed by computed fields, webquerysave agents, etc.

Remember to put computed fields below the computed for display fields.

0 comments: