logo       
Google Custom Search
    AddThis Social Bookmark Button

[FormBuilder] Source::File & perl statement validation: msg#00022

Subject: [FormBuilder] Source::File & perl statement validation
I'm having trouble setting up my forms with the standard source::file  
configuration method. I need to do some validation routines in perl,  
but when I add these to my config.fb file, it does not load  
correctly. I suspect I am not indenting or quoting correctly, but I  
was unable to find it documented in CGI::FormBuilder::Source::File.

When I remove the 'profit' field and and its associated validator  
everything works as expected. I'm hoping that someone on the list has  
encountered this before and has an example of how to do it correctly.

Here is an example


name: income_reg
method: post
fields:
   year_ended:
    label: FY End Date
    message: - Enter date in format MM/DD/YYYY
   sales:
    message: - Sales must be a number. Enter 0 for no sales.
   expenses:
    message: - Required. Enter 0 for no expenses.
   profit:
    message: - Must equal sales less expenses.
                
validate:
   year_ended: DATE
   sales: NUM
   expenses: NUM
   profit: perl: '== ($c->form->field("sales") - $c->form->field 
("expenses"))'

submit: Save Financials


I have also tried:

profit:
  perl: ...

All the best,

Paul


_______________________________________________
FBusers mailing list
FBusers@xxxxxxxxxxxxxxx
http://www.formbuilder.org/mailman/listinfo/fbusers




Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>