PDA

View Full Version : [CLOSED] Special characters dosen't works in message box in IE8



Daly_AF
Aug 03, 2012, 10:34 AM
Hi,
I implemented a js function that itterates a string and dispaly a notification to inform user that the string contains special characters this is the code below :


var getSelectedFile = function (fieldID) {
var iChars = "\/:*?\"'<>|#{}%~&";
for (var i = 0; i < fieldID.getValue().length; i++) {
if (iChars.indexOf(fieldID.getValue().charAt(i)) != -1) {
Ext.Msg.show({
title: 'Warning',
msg: getFileUploadSpecialCharacterErrorMsg() + fieldID.getValue().charAt(i),
buttons: {
ok: 'ok',
},
closable:false,
icon: Ext.MessageBox.WARNING,
fn: function(btn) {
if (btn == 'ok') {
fieldID.clear();
}
}
});
return false;
}
}
};

This is the screent short [Msg missed the special character]
4572

Daniil
Aug 03, 2012, 11:47 AM
Hi,

Please try to replace

msg: getFileUploadSpecialCharacterErrorMsg() + fieldID.getValue().charAt(i)
with

msg: getFileUploadSpecialCharacterErrorMsg() + Ext.util.Format.htmlEncode(fieldID.getValue().char At(i))

Daly_AF
Aug 03, 2012, 12:01 PM
Thank you it works