GithubHelp home page GithubHelp logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024

Original comment by [email protected] on 18 Apr 2008 at 7:06

  • Added labels: Type-NewFeature
  • Removed labels: Type-Task

from qeephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024

Original comment by [email protected] on 19 Apr 2008 at 8:34

  • Added labels: Component-Helper, Milestone-2.0

from qeephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024

Original comment by [email protected] on 3 May 2008 at 3:21

  • Added labels: Milestone-2.1
  • Removed labels: Milestone-2.0

from qeephp.

GoogleCodeExporter avatar GoogleCodeExporter commented on August 17, 2024
可以参考 jquery 
的做法,为需要验证的表单元件添加“validations“属性,例如
:

{{{
<input type="text" name="number" validations="is_int" />
}}}

不过这种做法的弊端就是太多的验证及验证参数会导致 html 
代码变得臃肿。所以可以考虑使用下面的
验证模式:

{{{
<script>
form_validations = {
  'number': {
     ['is_int', '必须是一个整数'],
     ['greater_than', 5, '必须大于 5']
  },

  ...
};
}}}

然后用这个规则来验证表单。如此可以保持表单 html 
代码的整洁。




Original comment by [email protected] on 17 Oct 2008 at 5:07

from qeephp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.