Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #36 from davewood/master

cookbook recipe for accessing db field for other fields default value
  • Loading branch information...
commit 35f4643a74ef46267d19bd8439cde6eb1a8db8c4 2 parents 089f610 + 6cf088b
@gshank authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 lib/HTML/FormHandler/Manual/Cookbook.pod
View
11 lib/HTML/FormHandler/Manual/Cookbook.pod
@@ -358,6 +358,17 @@ set in the update_model method;
$self->next::method;
}
+If you need to access a database field in order to create the value for a
+form field you can use a C< default_* > method.
+
+ sub default_myformfield {
+ my ($self, $field, $item) = @_;
+ return unless defined $item;
+ my $databasefield = $item->databasefield;
+ my $value = ... # do stuff
+ return $value;
+ }
+
=head2 Additional changes to the database
If you want to do additional database updates besides the ones that FormHandler
Please sign in to comment.
Something went wrong with that request. Please try again.