You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by "Justin M. Harrison" <sh...@doublebagel.com> on 2002/08/13 03:18:27 UTC

Form Validate Error

Hi,

I am attempting to validate a submitted form via code called in an
imported object perl module.

This is the error I am receiving:

ERR: 24: Error in Perl code: Can't locate object method
"validate_Username was not entered" via package
"Embperl::Form::Validate::Default" (perhaps you forgot to load
"Embperl::Form::Validate::Default"?) at
/usr/lib/perl5/site_perl/i386-linux/Embperl/Form/Validate.pm line 317.


----------------------------------------------

The calling code:

	use Embperl::Form::Validate;
	use rules;
	$epf = new Embperl::Form::Validate(&loginform,"login");
	print "Epf: $epf\n";
	$epf->validate_messages;


----------------------------------------------

Rules.pm:

sub loginform {
return([
	[-key => 'username',
  	-name => 'username'
  	-msg => "Username was not entered",
  	required=>1.
	-msg => "Username was too short",
	length_min=>1,
	-msg => "Username was too long",
	length_max=>15,
	],
	[-key => 'password',
	-name => 'password',
  	-msg => "Password was not entered",
  	required=>1.
	-msg => "Password was too short",
	length_min=>1,
	-msg => "Password was too long",
	length_max=>15,
	]
]);
}

1;

----------------------------------------------

It appears to be receiving the rules and form fields in $fdat fine. I am
not sure what is causing this error.

Does anybody have any clues?

Thanks

Justin


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: Form Validate Error

Posted by Justin Harrison <sh...@doublebagel.com>.
Esh :-)

When all else fails, try the obvious, eh? Thanks!

Justin

> -----Original Message-----
> From: Gavin Carr [mailto:gavin@openfusion.com.au] 
> Sent: Monday, August 12, 2002 9:25 PM
> To: embperl@perl.apache.org
> Subject: Re: Form Validate Error
> 
> 
> On Mon, Aug 12, 2002 at 09:18:27PM -0400, Justin M. Harrison wrote:
> > Rules.pm:
> > 
> > sub loginform {
> > return([
> > 	[-key => 'username',
> >   	-name => 'username'
> 
> Missing comma. :-)
> 
> >   	-msg => "Username was not entered",
> >   	required=>1.
> > 	-msg => "Username was too short",
> > 	length_min=>1,
> > 	-msg => "Username was too long",
> > 	length_max=>15,
> > 	],
> > 	[-key => 'password',
> > 	-name => 'password',
> >   	-msg => "Password was not entered",
> >   	required=>1.
> > 	-msg => "Password was too short",
> > 	length_min=>1,
> > 	-msg => "Password was too long",
> > 	length_max=>15,
> > 	]
> > ]);
> > }
> > 
> > 1;
> 
> -- 
> Open Fusion Pty. Ltd. - Open Source Business Solutions 
http://www.openfusion.com.au
- Fashion is a variable, but style is a constant - Programming Perl

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: Form Validate Error

Posted by Gavin Carr <ga...@openfusion.com.au>.
On Mon, Aug 12, 2002 at 09:18:27PM -0400, Justin M. Harrison wrote:
> Rules.pm:
> 
> sub loginform {
> return([
> 	[-key => 'username',
>   	-name => 'username'

Missing comma. :-)

>   	-msg => "Username was not entered",
>   	required=>1.
> 	-msg => "Username was too short",
> 	length_min=>1,
> 	-msg => "Username was too long",
> 	length_max=>15,
> 	],
> 	[-key => 'password',
> 	-name => 'password',
>   	-msg => "Password was not entered",
>   	required=>1.
> 	-msg => "Password was too short",
> 	length_min=>1,
> 	-msg => "Password was too long",
> 	length_max=>15,
> 	]
> ]);
> }
> 
> 1;

-- 
Open Fusion Pty. Ltd. - Open Source Business Solutions
http://www.openfusion.com.au
- Fashion is a variable, but style is a constant - Programming Perl

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: Form Validate Error

Posted by Justin Harrison <sh...@doublebagel.com>.
(Regarding line:

$epf->validate_messages;

It is actually:

$errors = $epf -> validate_messages;

But I commented it out for testing. It doesn't seem to make much
difference if I use:

$errors = $epf -> validate_messages($fdat);

)

> -----Original Message-----
> From: Justin M. Harrison [mailto:shadowj4@doublebagel.com] 
> Sent: Monday, August 12, 2002 9:18 PM
> To: embperl@perl.apache.org
> Subject: Form Validate Error
> 
> 
> Hi,
> 
> I am attempting to validate a submitted form via code called 
> in an imported object perl module.
> 
> This is the error I am receiving:
> 
> ERR: 24: Error in Perl code: Can't locate object method 
> "validate_Username was not entered" via package 
> "Embperl::Form::Validate::Default" (perhaps you forgot to load
> "Embperl::Form::Validate::Default"?) at 
> /usr/lib/perl5/site_perl/i386-linux/Embperl/Form/Validate.pm line 317.
> 
> 
> ----------------------------------------------
> 
> The calling code:
> 
> 	use Embperl::Form::Validate;
> 	use rules;
> 	$epf = new Embperl::Form::Validate(&loginform,"login");
> 	print "Epf: $epf\n";
> 	$epf->validate_messages;
> 
> 
> ----------------------------------------------
> 
> Rules.pm:
> 
> sub loginform {
> return([
> 	[-key => 'username',
>   	-name => 'username'
>   	-msg => "Username was not entered",
>   	required=>1.
> 	-msg => "Username was too short",
> 	length_min=>1,
> 	-msg => "Username was too long",
> 	length_max=>15,
> 	],
> 	[-key => 'password',
> 	-name => 'password',
>   	-msg => "Password was not entered",
>   	required=>1.
> 	-msg => "Password was too short",
> 	length_min=>1,
> 	-msg => "Password was too long",
> 	length_max=>15,
> 	]
> ]);
> }
> 
> 1;
> 
> ----------------------------------------------
> 
> It appears to be receiving the rules and form fields in $fdat 
> fine. I am not sure what is causing this error.
> 
> Does anybody have any clues?
> 
> Thanks
> 
> Justin
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org