Ajaxvalidator of formvalidator3.3 has some exceptions.

Source: Internet
Author: User

The author's statement on ajaxvalidator is as follows:

Ajaxvalidator is the most frequently asked question. Correct a bug (thanks to "too many errors √") and explain the most important questions.
BUG: no matter whether the verification is successful or not, when the control gets the focus again and loses the focus again, the tip prompts will be stuck in the focus prompt.
History of previous upgrades:
A. Add an addidvalue attribute for ajaxvalidator (whether to automatically add the ID and value to the end of the URL parameter)
To fix the bug that ajaxvalidator cannot get the runtime value when Configuring Information, the plug-in automatically adds a webpage parameter in the form of "id = value" after the URL.
On the server side, you can use request. querystring ["ID"] to set the value. For more information, see demo1 user name input and default. aspx.

Exception description:

Garbled characters still occur during development.

For example:

$ ("# Thename "). formvalidator ({onfocus: "The user name must be at least 6 characters and a maximum of 40 characters", oncorrect: "The input format is correct "}). inputvalidator ({min: 6, Max: 40, onerror: "The user name you entered is invalid. Please confirm "})//. regexvalidator ({Regexp: "username", datatype: "Enum", onerror: "Incorrect username format "})
. Ajaxvalidator ({
Type: "Get ",
URL: "login. Do ",
Data: "Action = isexist ",
Datatype: "XML ",
Success: function (data ){
Root = data.doc umentelement;
VaR rowset = root. selectnodes ("// Delete ");
If (rowset. Item (0). selectsinglenode ("value"). Text = "0 ")
{
Return true;
}
Else
{
Return false;
}
},
Buttons: $ ("# saveid "),
Error: function () {alert ("the server does not return data. The server may be busy. Please try again ");},
Onerror: "This user name is unavailable. Please change the user name ",
Onwait: "the validity of the user name is being verified. Please wait..." // function () {alert ($ ("# pcode"). Val ());}
});

Note:

Data: "Action = isexist & thename =" + $ ('# thename '). val (). This method is invalid because $ ('# thename '). val () is fixed, and is the initial value, usually empty.

Modify source code:

Formvalidator. js

// Ajax Verification
Ajaxvalid: In the function (returnobj) Method

Set

VaR parm = "clientid =" + ID + "&" + ID + "=" + encodeuricomponent (srcjo. Val ());

Changed:

VaR parm = "clientid =" + ID + "&" + ID + "=" + encodeuricomponent (srcjo. Val ()));

Because only the front-end code is encoded twice, the backend decoding can solve the garbled problem.

Thename = java.net. urldecoder. Decode (thename, "UTF-8 ");

Note that the front-end must be encoded twice, otherwise it will still be garbled.

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.