Hi,

I have a form that should have today's date in it unless otherwise
specified. I kind of hacked around this by saying:

    my $dt = DateTime->today(time_zone => 'local');
    foreach my $field qw(year month day) {
        my $element = $form->get_field(name => $field, type => 'text');
        next unless $element;
        $element->attributes->{value} ||= $dt->$field;
    }

Is there are preferred/recommended way to do this?

--d


_______________________________________________
Html-widget mailing list
Html-widget@lists.rawmode.org
http://lists.rawmode.org/cgi-bin/mailman/listinfo/html-widget

Reply via email to