Tracked Value Form with Change Log
This page uses a Hashtag Form to create, update, or delete a Tracked Value.
The form is styled using Bootstrap 3 default theme classes.
Form Actions are used to log all changes, recording both the old and new values.
Processed this Hashtag Markup:
<# start form for tracked_values <#[url.edit]#>;
set form.class to "form-horizontal";
when creating
create new record for "tracked_values_changelog";
set tracked_value_id to "<# form.id #>";
set type to "Create";
set name to "Tracked";
set old to "";
set new to "<# form.tracked #>";
when updating and ("<# form.tracked #>"!="<# tracked #>")
create new record for "tracked_values_changelog";
set tracked_value_id to "<# form.id #>";
set type to "Update";
set name to "Tracked";
set old to "<# tracked #>";
set new to "<# form.tracked #>";
when deleting
create new record for "tracked_values_changelog";
set tracked_value_id to "<# form.id #>";
set type to "Delete";
set name to "Tracked";
set old to "<# tracked #>";
set new to "";
when done redirect to "/changelog/list?index=<# form.id #>";
#>
<div class="form-group">
<label for="tracked" class="col-sm-3 control-label">Tracked Value</label>
<div class="col-sm-3">
<input type="text" <# Tracked #> class="form-control" id="tracked">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-3 col-sm-6">
<input type="button" <# Create button #> class="btn btn-primary">
<input type="button" <# Update button #> class="btn btn-primary">
<input type="button" <# Delete button #> class="btn btn-primary">
</div>
</div>
<# end form #>