Validate - Displaying default error messages
Hi,
I have, what I believe is, a simple question. I have a pretty large form with lots of validation and I am using the basic error placement:
- errorContainer: "#errorContainer",
- errorLabelContainer: "#errorContainer ul",
- wrapper: "li",
- errorClass: "invalid"
All of my validations work great, except I have one validation that uses remote and needs to do a few things on response:
- , remote:
- {
- url: "_ajax/CheckTriggerPoints.cfm",
- type: "post",
- data:
- {
- facility_id: 1234,
- element_id: 24
- },
- success: function(data)
- {
- if (data.toString() == 'false')
- {
- $('#OVERRIDE_TRIGGER_CONTAINER_#qElements.Element_ID#').show();
-
- $('#ELEMENT_#qElements.Element_ID#').addClass('invalid');
- $('#errorContainer ul').append('<li>Test</li>');
- $('#errorContainer').show();
- }
- }
So, basically, if the remote response is false, it "shows" a div somewhere with additional information... this information is not part of the error message so that is why I'm not using errorPlacement, however, if the response is false, I still want it to prompt the normal errorContainer because the value is still in error and needs to be corrected, but I guess since I have a success handler, it is not triggering the default error messages.
I've tried handling this manually with the addClass, append and show, but it just doesn't work very well. Is there some simple way of just returning false or something so that the normal validation handler recognizes the value is in error?
Thanks,
-Steve