4

I'm trying to validate against a remote request, but the result is pulling in template info as well - throwing off my true/false response. This works fine outside of Joomla, but I'm not finding a way of fixing it in Joomla.

http://jqueryvalidation.org/remote-method/

Jquery:

jQuery( "#modalform" ).validate({
    rules: {
        chosen_domain: {
            required: true,
            minlength: 4,
            remote: "index.php?option=com_component&task=checkDomain&tmpl=component"
        }
    },
    messages: {
        chosen_domain: {
            required: "Required input",
            minlength: jQuery.validator.format("Please, at least {0} characters are necessary"),
            remote: jQuery.validator.format("{0} is already in use"),
        }
    }
});

Response:

  <body class="contentpane">
    <div id="window-mainbody" class="window-mainbody">
      <div id="system-message-container">
    </div>

      "false"
    </div>
  </body>
2
  • 1
    What happens if you add &format=raw after &tmpl=component?
    – Lodder
    Commented Nov 1, 2014 at 10:02
  • That did it, thanks! I should have seen that... Make it a comment, and I'll accept it.
    – James
    Commented Nov 1, 2014 at 23:40

1 Answer 1

3

You need to add &format=raw at the end of the URL so it will look like the following:

index.php?option=com_component&task=checkDomain&tmpl=component&format=raw

Hope this helps

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.