You are here: Re: Best solution to tedious form validation? « PHP Programming Language « IT news, forums, messages
Re: Best solution to tedious form validation?

Posted by Jeff North on 10/27/07 02:45

On Fri, 26 Oct 2007 18:47:42 +0200, in comp.lang.php Gustaf
<gustafl@algonet.se>
<mZednQQ7tZOnh7_aRVnyjgA@giganews.com> wrote:

>| I've been working on a membership form for a while, and find it very
>| tedious to get an acceptable level of form validation. A web search for
>| solutions revealed some home-brewed solutions, such as these:
>|
>| http://simonwillison.net/2003/Jun/17/theHolyGrail/
>| http://samuelsjoberg.com/archive/2004/11/form-validation-on-client-and-server
>|
>| Quoting from the first link, this is my idea of what form validation is
>| like from the user's perspective:
>|
>| 1. The form is displayed; you fill it in.
>| 2. You submit the form to the server.
>| 3. If you missed something out or provided invalid input, the form is
>| redisplayed pre-filled with the valid data you already entered.
>| 4. The redisplayed form tells you what you got wrong. It also flags
>| the fields that were incorrect.
>| 5. Loop until you fill the form in correctly.
>|
>| In my membership form, I've found this to be complicated, error-prone
>| and tedious if coded by hand in PHP. Plus, I find that very little of
>| the code that comes out of it can be reused. There must be a better way...

Have you looked at Pear::QuickForms ?
http://pear.php.net/package/HTML_QuickForm2
http://www.midnighthax.com/smarty-guide.php

>| I'm all for coding by hand, but in this case, the most productive
>| environment I can imagine would be a WYSIWYG IDE environment, where you
>| draw the form and pick most properties from drop-down lists. The IDE
>| would then generate all the code for you, and offer to FTP it to the
>| right location. I believe this is what Microsoft wanted to accomplish
>| with Web Forms in ASP.NET. The big drawback there (correct me if I'm
>| wrong) is that ASP.NET forms only work on IIS servers and IE clients. Is
>| there anything like ASP.NET Web forms, but less MS-centric, and using
>| PHP code? If not, what's the next best solution?
>|
>| Many thanks in advance.
>|
>| Gustaf
-- -------------------------------------------------------------
jnorthau@yourpantsyahoo.com.au : Remove your pants to reply
-- -------------------------------------------------------------

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация