logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

better msg handling in FormValidator ?: msg#00000

lang.perl.modules.cgi-appplication

Subject: better msg handling in FormValidator ?

Hi,

i am using C::A::P::ValidateRM and it has been great. one thing i don't like
what i am doing is
the way of organizing customized message for form error.

currently i have something like this:

constraint_methods => {
a_field => sub { my ($dfv, $val) = @_;
if $val matches html tag
$dfv->name_is('html_tag_found');
return;
} else { return 1 }
}
}
msgs => {
prefix => 'err_',
any_errors => 'some_errors',
constrains => { html_tag_found => 'html tag is not allowed in this
field', }
}

a good thing about the above is that, i can use [% err_a_field %] in my
template without
conditionaly looking up what exact error it is.

it is okay when i have only one or two forms. but it gets a bit out of hand to
maintain the
message system. i already have the real messages stored in a config file
instead of hardcoded it
in the module.
also, it seems redundant to have 'html_tag_found' in the constraint_methods and
in msgs.

i am wondering how are other people using DFV and i would like to adopt a
simpler and
maintaintable way..


thanks,

James.



____________________________________________________________________________________
Got a little couch potato?
Check out fun summer activities for kids.
http://search.yahoo.com/search?fr=oni_on_mail&p=summer+activities+for+kids&cs=bz


---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/cgiapp@xxxxxxxxxxxxxxxxx/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: cgiapp-unsubscribe@xxxxxxxxxxxxxxxxx
For additional commands, e-mail: cgiapp-help@xxxxxxxxxxxxxxxxx




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
krysalis.sandbo...    web.zope.zwiki/...    gnome.apps.gnum...    xfree86.newbie/...    editors.vim/200...    mozilla.enigmai...    boot-loaders.gr...    network.vnc.ult...    redhat.release....    java.geronimo.u...    os.netbsd.devel...    horde.wicked/20...    linux.lsb.discu...    ietf.ips/2005-0...    alsa.devel/2002...    user-groups.lin...    package-managem...    debian.devel.da...    security.cyrus....    video.gstreamer...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation