Ciao everybody
I am having a weird problem with PerForm. After playing a little and building my form interface, I started working on the callbacks. Since there are a bunch of fields that should just not be empty I wrote this callback:
sub validate_notempty {
my ($ctxt,$value,$index) = @_ ;
die "Null value not allowed" if $value =~ /^\s*$/ ;
}which I put in a <xsp:logic> section just inside the <xsp:page> and before any other "custom tag". In all the textfields that need to be checked for non-nullness i put a 'onvalidate="validate_notempty"' attribute.
I then submitted the form but, with my surprise, it looked like nothing happened. I then added a
warn "[$value]" ;
just before the "die" and submitted again: nothing appeared in the error log. It just looked like it wasn't executing the callback, but with no apparent error. I then removed the onvalidate attribute from a textfield and added this just after the sub:
*validate_servizio = \&validate_notempty ;
This time, for just the "servizio" textfield, I saw the error in the form and a line
[] at (eval 394) line 31.
in the error log.
So it looks like the onvalidate attribute is read, but the callback is not executed...
Any clues?
Ciao and thanks --bronto
--
Marco Marongiu Tiscali Services s.r.l.
System Engineer S.S. 195, km 2,300
IT Systems Management Dept. Loc. "Sa Illetta"
Phone: +39 070 460 1684 09122 Cagliari (CA)
Fax: +39 070 460 9684 Sardegna - Italia
------------------------------------------------------------------------
If you don't know where you're going / any road will take you there
-- George Harrison, "Any Road", Brainwashed, 2002
--------------------------------------------------------------------------------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
