Nimisha
06-12-2003, 02:13 AM
Hi Dave
I'm back with the same problem well almost.
I did create function which validate that there are no meta tags i.e. "<" or ">" being inserted by the user into the text box. I call this function on the onkeyup of the text box. The function gets called and works fine if the meta tag is the first character in the text box, but if the user enters some text and then enters either < or > character, the functions doesnot do anything.
function CheckAnyMetaTagCharacters()
{
var sName;
var sContents;
sName = document.frmContact.txtTagName ;
if (sName.value == "<" || sName.value == ">" || sName.value == "<>" )
{
alert ("NO '<' or '>' allowed");
sName.focus();
sName.select();
return false;
}
}
<input type="text" name="txtTagName" width="100%" maxLength="255" onkeyup ="return CheckAnyMetaTagCharacters()" size="50">
Thoughts/help will be greatly appreciated.
Ta
Nimisha
I'm back with the same problem well almost.
I did create function which validate that there are no meta tags i.e. "<" or ">" being inserted by the user into the text box. I call this function on the onkeyup of the text box. The function gets called and works fine if the meta tag is the first character in the text box, but if the user enters some text and then enters either < or > character, the functions doesnot do anything.
function CheckAnyMetaTagCharacters()
{
var sName;
var sContents;
sName = document.frmContact.txtTagName ;
if (sName.value == "<" || sName.value == ">" || sName.value == "<>" )
{
alert ("NO '<' or '>' allowed");
sName.focus();
sName.select();
return false;
}
}
<input type="text" name="txtTagName" width="100%" maxLength="255" onkeyup ="return CheckAnyMetaTagCharacters()" size="50">
Thoughts/help will be greatly appreciated.
Ta
Nimisha