|
|
Choosing A Webhost: |
Re: better msg handling in FormValidator ?: msg#00003lang.perl.modules.cgi-appplication
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> |
|---|---|---|
| Previous by Date: | Re: better msg handling in FormValidator ?, James.Q.L |
|---|---|
| Next by Date: | RFC: plugin to handle pairs of routines form display and processing, Mark Stosberg |
| Previous by Thread: | Re: better msg handling in FormValidator ?, James.Q.L |
| Next by Thread: | Re: better msg handling in FormValidator ?, James.Q.L |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive 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 |