durangod
09-30-2012, 03:17 AM
Hi this works perfect in IE but it does not even raise a flag (alert) at all in FF or chrome, it totally ignores it other than IE
if ((document.FrmAdvert.txtComment.value.length > 1 && document.FrmAdvert.txtComment.value != ''))
{
var str=document.getElementById("txtComment").innerHTML;
if(/(.)\1{2,}/i.test(str))
{
alert("Duplicate Characters in a row, Please remove duplicate characters!");
var newfield = str;
//dont replace the txt for edit profile (since not new reg and content exists) just make the text the old text so they can correct it
// str.replace(/(.)\1{3,}/gi,"wrong content");
document.getElementById("txtComment").innerHTML=newfield;
document.FrmAdvert.txtComment.focus();
return (false);
}//close if test
}//close if value
if ((document.FrmAdvert.txtComment.value.length > 1 && document.FrmAdvert.txtComment.value != ''))
{
var str=document.getElementById("txtComment").innerHTML;
if(/(.)\1{2,}/i.test(str))
{
alert("Duplicate Characters in a row, Please remove duplicate characters!");
var newfield = str;
//dont replace the txt for edit profile (since not new reg and content exists) just make the text the old text so they can correct it
// str.replace(/(.)\1{3,}/gi,"wrong content");
document.getElementById("txtComment").innerHTML=newfield;
document.FrmAdvert.txtComment.focus();
return (false);
}//close if test
}//close if value