provide. You could set the dataFilter-ajax-option (see
http://docs.jquery.com/Ajax/jQuery.ajax#options) to postprocess the
response.
remote: {
url: "webservice...",
dataFilter: function(data) {
return process(data);
}
}
Jörn
On Tue, Mar 31, 2009 at 7:05 AM, pbarnes <pmbarnes@gmail.com> wrote:
>
> I'm trying to integrate the Validation plug-in with an ASP.NET site
> using ASMX services. The service is very simple: it takes in two
> strings and returns a boolean. I can see valid XML response in
> Firebug, but the plugin doesn't seem to process it properly. Both true
> and false return values result in no form submission and no error
> message (and any previous error messages, e.g., "You must enter at
> least 10 numbers") are not cleared.
>
> Here's my validation code:
>
> $('#aspnetForm').validate({
> rules: {
> phoneNumber: {
> required: true,
> minlength: 5,
> remote: {
> url: 'CorpSiteService.asmx/ValidatePhoneNumber',
> data: {
> countryId: function() {
> return $('#ctl00_ContentPlaceHolderBody_uxCountryDropDown').val
> ();
> }
> }
> }
> }
> },
> messages: {
> phoneNumber: {
> required: "A mobile number is required.",
> minlength: $.format("Enter at least {0} characters"),
> remote: "Invalid phone number for this carrier."
> }
> }
> });
>
> The response from the ASMX service is:
>
> <?xml version="1.0" encoding="utf-8"?>
> <boolean xmlns="http://svc.picdial.com/WebServices/">true</boolean>
>
> The end result is the same whether the Web service returns true or
> false.
No comments:
Post a Comment