On Thu, Sep 22, 2011 at 1:10 PM, J. Bobby Lopez <j...@jbldata.com> wrote:

>
> Hello,
>
> I'm trying to figure out how to pre-populate a formfu form with data I
> have in a %hash.  The keys in the hash match the names of form
> elements (if that's helpful at all).
>
> The problem I'm running into is understanding how $form->process()
> works if nothing has been submitted.  If there has been no form
> submission (and therefore no $query_object), how can I get formfu to
> populate fields with existing data from my %hash?
>
> Reviewing formfu docs didn't provide any insight on this (or I missed
> it).  Can anyone shed some light on this?
>
> Thanks,
> -Bobby
>
> _______________________________________________
> HTML-FormFu mailing list
> HTML-FormFu@lists.scsys.co.uk
> http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
>


Untested code, but something like...

while ( my ($name, $value) = each %hash_of_data ) {
  $form->get_element({name => $name})->value($value);
}



-- 
Steve Rippl
Technology Director
Woodland Public Schools
360 841 2730
_______________________________________________
HTML-FormFu mailing list
HTML-FormFu@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu

Reply via email to