Thanks Chris!
I ended up converting the code to javascript since iframe text is not posted
to the server.
Here are 2 functions I wrote.
Marcel
-----------------------------
function ClearHTMLTags(i nHTML) {
var regEx
var outText
// this pattern matches any html tag, g means don't stop after first
regEx = /<[^>]*>/g // or in other languages "<[^>]*>"
// remove any HTML tags
outText = inHTML.replace( regEx, "")
// remove any
regEx = / /g
outText = outText.replace (regEx, "")
// all html tags are stripped
return outText
}
// tests for an empty string - needs javascript1.2
function isStringEmpty(t extString)
{
var regexp = / /g // look for any space character and don't stop after first
g
var trimmedTxt = textString.repl ace(regexp, "") // remove any space
characters
regexp = /\s/g // look for white space \s character and don't stop after
first g
trimmedTxt = trimmedTxt.repl ace(regexp, "") // remove any white space
characters
if (trimmedTxt.len gth == 0) {
return true
}
return false
} // end: isStringEmpty()
"Chris Jackson" <chrisjATmvpsDO TorgNOSPAM> wrote in message
news:e4******** ******@TK2MSFTN GP12.phx.gbl...
Simply remove all HTML tags using regular expression functions, and then
take a look at the remaining string. Here is a sample of clearing tags:
http://www.4guysfromrolla.com/webtech/073000-1.shtml
--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--
"Marcel Balcarek" <ma************ *@REM-OVEMEtoxicall.c om> wrote in message
news:e8******** ********@TK2MSF TNGP12.phx.gbl. .. Hi,
Is there a way in .NET to convert InnerHtml text e.g. '<B>hello</B>' to
'hello' ??
In IE I can use myiframe.innerT ext to know whether a field is empty, but
in Netscape this method is not available.
myiframe.InnerH TML often has leftover html which converts to nothing in
the iframe (innertext), but is difficult to test for empty.
Any help is appreciated.
Marcel