Menu

#3 area.html is empty wheraes we submit a form with an <IMG >

open
nobody
None
5
2006-02-10
2006-02-10
Anonymous
No

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;

}

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.