简体   繁体   中英

Partial validation using cakephp

I'm new to cakePHP I want to know if there's a way to validate a form partially as in JavaScript.

Situation:
I have a select box with 2 options - 1. free, 2. paid
When paid is chosen a text input field appears for a price.

Any ideas?

Thanks in advance.

You can do custom validation rules. So, your form would validate differently, depending on if it's a paid user or a free one.

This link will give you some ideas of how to get started with it:

http://bakery.cakephp.org/articles/aranworld/2008/01/14/using-equalto-validation-to-compare-two-form-fields

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM