Yesterday, I wrote about how to quickly implement the form data validation method in the foreground, today, then yesterday, the background of the implementation of data validation methods recorded. First of all, I'm using ASP. So the background verification method is also based on. NET MVC.
Well, gossip, I'm back to the chase.
Background implementation of form
= "position: absolute; left: 0; top: 0; background-color: # dceaf2; padding: 3px; border: solid 1px #6dbde4; visibility: hidden; line-height: 20px; "; $ (" body "). append ("
How to use:
1. Reference CSS and JS (jQuery must be referenced ):
2. Form HTML code (partial code ):
3. Execute the verification JS Code:
// Save data function save () {if (SimpoValidate
codeThe Code is as follows:Protected function replaceFoo ($ message, $ attribute, $ rule, $ parameters){Return str_replace (': foo', $ parameters [0], $ message );}
How can I call multiple form verification functions in javascript?
You can write a method summary.For example:Function checkFrom (){Return method1 () method2 () method3 () method4 () method5 ()..;}However, it is best to sort out the
support asynchronous verification, such as verifying whether the user name exists:
The plug-in supports asynchronous verification.3. Support for multi-type rule verification
In addition, different types of rule verification are supported, such as required/format/custom. For example, there are two requirements for phon
exists:
The plug-in supports asynchronous verification.
3. Support for multi-type rule verification
In addition, different types of rule verification are supported, such as required/format/custom. For example, there are two requirements for phone number verification. One is required, the other is in line with the pho
(??, ' age ' is a required field);
}
else if (person. Age > 25 | | Person.
Age
3.View in:
The extension method that calls Htmlhelper
@using (Html.BeginForm ())
{
@Html. Editorformodel ()
Five. Jquery Validate plug-in form v
Jquery Form Verification plug-in formValidator usage, jqueryform Verification
Procedure:
1. First add necessary js and css to the Project
2. add reference to the code (mandatory reference)
3. The tag to be verified in
4. Code in
5 .:
6. Add modification instructions:
$. FormValidator. reloadAutoTip (); // reload the Fo
This article will introduce you to the Skygq Form Verification example for no-refreshing ajax form submission. If you need to know more, please refer.
1. For special requirements of input checkbox selection, we can limit the number of options, so that we can select only a few or between several.2. For the input text field, you can set that the input value must be
custom verification, that is, it needs to be unique. This is the way it is written in html, and the custom js Code is written by itself, here is the corresponding code, which is written using commands.
angular.module('myApp', []).directive('ensureUnique', ['$http', function($http) {return {require: 'ngModel',link: function(scope, ele, attrs, c) {scope.$watch(attrs.ngModel, function() {$http({method: 'POST'
Simple Example of jQuery form verification, jquery form example
This example describes the simple usage of jQuery form verification. We will share this with you for your reference. The details are as follows:
I have been working on a for
Compile the jQuery plug-in form verification by yourself and compile the jquery plug-in form
Let's talk about it first: I am in a bad state recently. I really don't want to do anything, don't want to go to work, and I don't have the motivation to do anything. I feel boring. Don't want to do this. Don't want to do this. Just let it disappear. Suddenly ....
Django form post has two solutions: CSRF verification failed (CSRF verification failed)Symptom
The form interface is as follows:
After clicking submit, the following error page appears:
The HTML code is as follows:
Contact_form.html
The view code is as follows:
View.
TP data validation There are two ways, one is static mode, one is dynamic, the following small series to everyone brought the thinkphp framework form verification and Ajax verification problems, interested friends to see it together
The previous form validation was written in JS, which can also be verified using the T
JQuery formValidator Form Verification and jqueryform Verification
As a programmer, it is necessary to make some conclusions after solving problems encountered in the work. It is not only convenient to summarize the knowledge points, but also provides some work experience for the majority of programmers, give an explanation to your peers.
Javascript Form Verification length, javascript form
JavaScript can be used to verify the input data in the HTML form before the data is sent to the server.
What method should we use to remind users? You do not want to use the alert () Prompt box
Add an sqan label after the
form is one of the main external forms of dynamic Web page implementation. Forms and form fields do not have the ability to compose, and the form page is ultimately organized by a table. HTML forms are an important means of interacting with the browser side of HTML pages. Fo
This article mainly introduces the usage of php form-based password verification and HTTP authentication, and analyzes in detail the principles and precautions of form-based password verification and HTTP authentication in the form of instances, it has some reference value.
-mail verificationThe following function checks whether the input data conforms to the basic syntax of an e-mail address.This means that the data entered must contain the @ symbol and the dot (.). At the same time, @ cannot be the first character of the email address and must have at least one dot after @:function Validate_email (field,alerttxt){With (field){Apos=value.indexof ("@")Dotpos=value.lastindexof (".")if (apos{alert (alerttxt); return false}else {return true}}}Here is the complete code
Simple Example of HTML5 form verification, html5 form exampleThis article mainly introduces a simple example of using HTML5 form verification, including a small example of using a mobile phone. For more information, see
HTML5 provides the patern attribute for
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.