自动表格验证? [英] Automated Form Validation?

查看:63
本文介绍了自动表格验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在愚蠢的表格验证上编码好几天后 -

喜欢:

字符串(最小/最大长度),数字(最小/最大值),金钱(最小/最大值

值),邮政编码(最小/最大值),电话号码,

电子邮件地址等等。


我认为这可能是一种更好的方法来编程一个适用于各种领域的自动,动态的
表单验证,显示

必要的错误消息并突出显示相应的形式领域。


在我开始重新发明轮子之前,我想我应该问你们各位

如果有人之前这样做过,或者有一些好的话

的例子如何在网上做这个?


谢谢,


Stefan

Hi, after coding for days on stupid form validations -
Like:
strings (min / max length), numbers(min / max value), money(min / max
value), postcodes(min / max value), telefon numbers,
email adresses and so on.

I thought it might be a better way to programm an automated, dynamic
form validation that works for all kinds of fields, shows the
necessary error messages and highlights the coresponding form fields.

Before I start to reinvent the wheel I thought I should ask you guys
if someone has done this before, or if there are some good examples of
how to do this on the web?


Thanks,

Stefan

推荐答案

" Stefan Richter" <做**** @ gmx.de>在留言中写道

新闻:e2 ************************** @ posting.google.c om ...

:在愚蠢的表格验证上编码好几天后 -

:喜欢:

:字符串(最小/最大长度),数字(最小/最大价值),金钱(最小/最高

:价值),邮政编码(最小/最大价值),电话号码,

:电子邮件地址等。< br $> b $ b:

:我认为这可能是一种更好的方法来编程自动化,动态的
:表单验证,适用于各种领域,显示

:必要的错误消息并突出显示相应的表单字段。



:在我开始重新发明轮子之前我认为我应该问你们各位

:如果有人之前做过这个,或者有一些很好的例子

:如何在网上做到这一点?


我已经自己动手了,因为我怀疑这里有很多人;那就是说,

是很多优秀的在线课程库!


对于初学者来说,看看 http://pear.php.net/ http://phpclasses.org/

(在Manuel Lemos获得插件之前......)。


还有很多PHP应用程序框架(在谷歌搜索这个)

系统,这将提供这种东西 - 我希望像

phppeanuts这样的东西可能会做它...


Matt
"Stefan Richter" <Do****@gmx.de> wrote in message
news:e2**************************@posting.google.c om...
: Hi, after coding for days on stupid form validations -
: Like:
: strings (min / max length), numbers(min / max value), money(min / max
: value), postcodes(min / max value), telefon numbers,
: email adresses and so on.
:
: I thought it might be a better way to programm an automated, dynamic
: form validation that works for all kinds of fields, shows the
: necessary error messages and highlights the coresponding form fields.
:
: Before I start to reinvent the wheel I thought I should ask you guys
: if someone has done this before, or if there are some good examples of
: how to do this on the web?

I''ve rolled my own, as I suspect many people on here have; that said, there
are many excellent class libraries for this available online!

For starters, have a look on http://pear.php.net/ and http://phpclasses.org/
(before Manuel Lemos gets his plug in...).

There are also many PHP Application Framework (search for this on google)
systems, which will provide this kind of thing - I expect things like
phppeanuts probably do it...

Matt


Matt Mitchell写道:
Matt Mitchell wrote:
对于初学者,查看 http://pear.php.net/ http://phpclasses.org/
(在Manuel Lemos获得插件之前......) 。
For starters, have a look on http://pear.php.net/ and http://phpclasses.org/
(before Manuel Lemos gets his plug in...).




我有我一直在使用PEAR的QuickForm来做这种事情。

请参阅用户文档。并从那里快速启动。基本上,

一旦你向表单添加一个元素,你可以



I have been using PEAR''s QuickForm which does this kind of thing.
See the "User Documentation" and from there "Quick Start". Basically,
once you add an element to the form, you do


f-> addRule(...),和

QuickForm创建必要的JavaScript代码来验证字段。


/ Marcin
f->addRule(...), and
QuickForm creates the necessary JavaScript code to validate the fields.

/Marcin


这篇关于自动表格验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆