0

I'm currently adding some customizations to a SharePoint 2013 form using jQuery.

I could add some rules to the 'input' and 'select' elements, but I can't do it for a RichText Editor. Did anyone try it?

$('div[id*="Pepe"][class*="ms-rtestate-write"]').rules('add', {
    required: true,
    messages:
    {
        required: 'Pepe is required'
    }
});

Turning on the the debug option on $('form').validate(...) I got this error: "Uncaught TypeError: Cannot read property 'nodeType' of undefined"

1 Answer 1

2

I solved the problem by myself.

Solomonic solution: I didn't need a rich text type, so I changed the type to 'plain text'.

Now my validation is the following and it works like a charm:

$('textarea[title="Pepe"]').rules('add', {
    required: true,
    messages:
    {
        required: 'Pepe is required'
    }
});
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.