0

I have a list (MyList) with some columns. It also contains a column (Mydesc) which is a multiline text box having enhanced rich text. Now in the edit form I have to check whether any change occurs in the form. For every other column I can capture the change event but not for my "Mydesc" column. I tried this code but failing.

    $("#Mydesc_aede8400-1a1f-4071-b97a-188d2980b7b1_$TextField").keydown(function() {
alert('Testing...');
});

Error message is:

Syntax error, unrecognized expression: #Mydesc_aede8400-1a1f-4071-b97a-188d2980b7b1_$TextField

1 Answer 1

0

Your selector has a special character $ and it must be escaped with

two backslashes: \\

To use any of the meta-characters ( such as  !"#$%&'()*+,./:;<=>?@[\]^`{|}~ ) as a literal part of a name, it must be escaped with with two backslashes: \\. For example, an element with id="foo.bar", can use the selector $("#foo\\.bar"). 

https://api.jquery.com/category/selectors/

2
  • Also tried to fetch the ID using this statement
    – yash
    Commented Oct 21, 2016 at 10:07
  • $("textarea[Title='MyDesc']").closest("span").find("iframe[Title='Rich Text Editor']")
    – yash
    Commented Oct 21, 2016 at 10:08

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.