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...

Re: better msg handling in FormValidator ?: msg#00003

lang.perl.modules.cgi-appplication

Subject: Re: better msg handling in FormValidator ?

James.Q.L wrote:

> i have looked at smolder dfv error message handling before. i don't like to
> put the error messages
> in template. felt like hardcoded it too. esp when you have to do bunch of [%
> if err_a_filed %] ..
> [% ELSIF missing_a_filed %] ...

I don't see it as hard coding so much as giving the HTML/Design people the
ability to make the decision about what the message should be. But you get some
of the same benefits from using config files too.

> but it does give you the real flexiablity of setting up customized message.
>
> one question though, if a field (say username) required at least lenght of 6
> and contain only
> number and alphabet. how do you show different error based on user input for
> this single filed?

I do this in the custom messages sub. If you provide multiple constraints for
the same field you can give each one a name. Then when you call invalid() on the
D::FV::Results object passing in the name of the invalid field you get an array
ref containing the names of the validation constraints that failed. Smolder does
this and then uses it to set the error flags.

--
Michael Peters
Developer
Plus Three, LP


---------------------------------------------------------------------
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