, FCKeditor , , , TEXTAREA:
function FCKCopy() {
for (var i = 0; i < parent.frames.length; ++i ) {
if (parent.frames[i].FCK)
parent.frames[i].FCK.UpdateLinkedField();
}
}
HTML TEXTAREA:
function stripHTML(oldString) {
var matchTag = /<(?:.|\s)*?>/g;
return $.trim(oldString.replace(matchTag, ""));
}
The above function uses the jQuery trim function. Use jQuery or replace it with some cropping function for java script, for example:
function trimIt(text) {
rwhite = /\s/;
trimLeft = /^\s+/;
trimRight = /\s+$/;
if ( !rwhite.test( "\xA0" ) ) {
trimLeft = /^[\s\xA0]+/;
trimRight = /[\s\xA0]+$/;
}
return text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
}
Now you can check the TEXTAREA value, for example, as shown below:
if (stripHTML($('message').val()) == '') {
alert('Please enter Message.');
}
I hope it works as well as it does for me.
Good luck
source
share