area.html is empty wheraes we submit a form with an <IMG >
Brought to you by:
kalperin
When the hypertextarea contained only "<IMG
src='example.jpg'>" the result on submit is empty.
The solution:
function stripHTML(oldString) {
// on conserve dans la chaine les images pour
le test
var tmpString = oldString.replace(/(<IMG ([^>]
+)>)/ig,"IMAGE");
var newString = tmpString.replace(/(<([^>]+)
>)/ig,"");
//replace carriage returns and line feeds
newString = escape\(newString\)
newString = newString.replace\("%0D%0A"," "\);
newString = newString.replace\("%0A"," "\);
newString = newString.replace\("%0D"," "\);
newString = unescape\(newString\)
//trim string
newString = trim\(newString\);
return newString;
}