PDA

View Full Version : Uncaught InvalidCharacterError: The string contains invalid characters. model.set()



arponjude
4 Feb 2014, 4:48 AM
Hello,

Hope anybody can help me on this problem.
I have a text area with this value 'TEST' """ (single and double quotes).

When i call model.set('field', value) i got
Uncaught InvalidCharacterError: The string contains invalid characters.

Appreciate your help.

Thanks,

palakurthivishal
4 Feb 2014, 10:29 AM
Hello arponjude,
What is the datatype of the property "field" in your model?

arponjude
4 Feb 2014, 2:55 PM
Hi,

I made the model run, so the fields are created run-time with no type defined.

fields: ["field1", "field2" ... ]

Initial data is from the store, I noticed that field1 has a value of
This is a "TEST".
When I edit the model and set('field2') with single and double quotes then the exception haven.

Hope my explanation is clear.

Thanks,

paranella
8 Feb 2015, 4:24 PM
I read form values and set them to the record



rec.beginEdit();
Ext.Object.each(values, function(key, value, myself) {
rec.set(key, value);
});
rec.endEdit();


when rec.endEdit() is executed, if there is single quote in one of the values I recive the error


InvalidCharacterError: String contains an invalid character
dest.setAttribute(attName, newAttrs[i].value);


no problems with double quote charachter