Reputation: 271
I'd like to add a PHP Contact Form with Validation to my website. I can't seem to find an easy to set-up form.
I have a few other desired features I hope would be in some tpye of script out there!
First, I found a script that processes the form without page refresh. Plugin can be found here// http://net.tutsplus.com/tutorials/javascript-ajax/submit-a-form-without-page-refresh-using-jquery/
Second, Name validation, if the name is shorter than 3 characters than the error text says something similar to "name can not be shorter than 3 characters"
and
Third, Check for a VALID E-mail. So a fake E-mail is not accepted.
Is there any type of plug-in out there that have these features?
Upvotes: 0
Views: 386
Reputation: 3145
Sounds like you are ready to graduate to a Model/View/Controller environment. Give Kohana a look. http://kohanaframework.org.
Using Kohana, you can specify rules for validation like so:
$extra_validation = Validation::factory($this->request->post())
->rule('password', 'min_length', array(':value', 8))
->rule('password_confirm', 'not_empty')
->rule('home_city', 'not_empty');
// Create the user using form values
$user = ORM::factory('user')->values($this->request->post(), array(
'password',
'home_city',
))->create($extra_validation);
Upvotes: 1