开发者

cakephp server side validation issue

On my registration page, I have radio button to select user type, competitor or noncompetitor and both users have different database table to register into.

Now when I go开发者_JS百科 for validation, my url is like, noncompetitors/register and here is a whole form to enter registration information, now when user selects noncompetitor registration, it displays server side validations which cakephp provides, but when user tries to register with competitor, it doesn't go for server side validadtions, what can i do to apply both diff models validations to a single form, depending on registration selection?

Earliest reply would be appreciated.

Thanks !


You'll need to be more specific. If I understand the question correctly, you're trying to validate one or more fields in the form differently depending on whether someone selects competitor or noncompetitor. Is that right? Otherwise, please clarify your question.

If so, it seems like you could directly test the input. Something like this:

if($this->data['RegisterType'] == 'competitor' ) {
   [check to see if the field(s) your testing meet criteria X]
} else {
   [check to see if the field(s) your testing meet criteria X]
}

Again, I'm guessing at the issue, but hopefully I understood the question.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜