JQuery and PHPCodeIgniter form verification

Source: Internet
Author: User
Tags autoload codeigniter contact form droplist
Actual jQuery and PHPCodeIgniter form verification the original text is published in jQuery and PHP CodeIgniter form verification in NLP practice
Published in http://tech.it168.com/a2011/0818/1234/000001234617.shtml
Is my work, reprinted please note:

Preface

In Web site building, form validity verification is a very important step, including Javascript verification on the client browser and server. In this article, readers will be guided to use the validate verification framework in jQuery to write browser-side verification code. the validate framework is a very simple and practical verification framework that can greatly improve the compilation of client verification code, at the same time, this article uses the CodeIgniter framework that is very popular in php for server-side verification writing. This article is intended for readers who have some knowledge of jQuery and the PHP CodeIgniter framework.

Preparations

We must download CodeIgniter and jQuery. the version is as follows:

1. CodeIgniter 2.0.2 (: http://codeigniter.com/downloads)

2. jQuery 1.6.1 (: http://code.jquery.com/jquery-1.6.1.min.js)

3. jQuery validate framework, (: http://bassistance.de/jquery-plugins/jquery-plugin-validation)

Set CodeIgniter

We need to automatically load the url and use the form assistant class in CodeIgniter. Therefore, we add the following code in line 67th of the autoload. php application:

$ Autoload ['helper '] = array ('URL', 'form ');
Create a view layer file

Next, we start to compile the HTML page code of the page. we name the form you entered as form_view. If no error occurs after the verification is submitted successfully, the page showing the successful prompt is named success_view. of course, the code for the header and tail of the page is as follows:

Views/common/Header. php:





Form Validation-Gazpo.com

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.