Jump to content

[SOLVED] how to do validation?


chaiwei

Recommended Posts

Hi,

 

May I know how you all do validation for a for a form.

 

Normally we use ctype,filter,preg_match, check_date, is_string, is_?

But if I got a form having 100 of field,

 

It is impossible for me to go and validate all the field whether it is a valid date,

email, string.

 

is there any way to improve the form validation?

 

btw, ctype and filter which one is better?

Link to comment
Share on other sites

You could use a form class to build a form along with the validation. Most php frameworks( such as Zend Framework and CakePHP) include functionality to create forms a lot easier.

 

I do think that having a form with a hundred fields is a bit of an overkill. I mean If I saw a form with a 100 fields I would simply click the back button or some other action to go to another page.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.