jquery plugin validate inside the remote parameter usage

Source: Internet
Author: User

Validate verifies that the remote parameter is used in the asynchronous database query validation process.

There are url,datatype,data,type and so on in remote, the default is the value of the currently validated field when data is not written. To the PHP file, the return value is "true" or "false" when processed in the PHP file, and the return value needs to be quoted.

Here is a test case:

JS's wording

var option = {rules:{baleno:{required:true, remote:{url:checkbalenourl, type: ' Post ', DataType: ' JS On ',}}, expressnolist:{required:true},}, messages:{baleno:{required: ' Pallet number cannot be empty ', Remote: ' The pallet number has been saved In ',}, expressnolist:{required: "Waybill number cannot be empty"},}};

Syntax for methods in PHP:

Public Function Ajaxchecktrayno () {if ($_request[' Baleno ']!= ') {$model = M ("Ordertray");   $map [' tray_no '] = $_request[' Baleno ');   $number = $model, where ($map), count ();   if ($number >0) {echo "false";   }else{echo "true";  }}else{echo "false"; } }

This article is from "Buffy Rain Blog" blog, please be sure to keep this source http://bafeiyu.blog.51cto.com/5401101/1599317

jquery plugin validate inside the remote parameter usage

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.