Replace problem

Hi, I tried to remove the < and > from a string with this self
written function. But even when the string contains < and > it won't
be replaced.

What is wrong?

Function unHTML(dezeString)
dezeString = Replace(dezeString,"<","<")
dezeString = Replace(dezeString,">",">")
dezeString = Replace(dezeString,"'","´")
unHTML = dezeString
End Function

strVoornaam = unHTML(Request.Form("Voornaam"))



for example: Voornaam = PETE
will still be: Voornaam = PETE
in case of: Voornaam = PETE
[hr]
[red]The 100[/red] best Dutch [blue]websites (free participation):[/blue]
:-) http://www.top100nederland.tk/

Comments

  • : Hi, I tried to remove the < and > from a string with this self
    : written function. But even when the string contains < and > it won't
    : be replaced.
    :
    : What is wrong?
    :
    : Function unHTML(dezeString)
    : dezeString = Replace(dezeString,"<","<")
    : dezeString = Replace(dezeString,">",">")
    : dezeString = Replace(dezeString,"'","´")
    : unHTML = dezeString
    : End Function
    :
    : strVoornaam = unHTML(Request.Form("Voornaam"))
    :
    :
    :
    : for example: Voornaam = PETE
    : will still be: Voornaam = PETE
    : in case of: Voornaam = PETE
    : [hr]
    : [red]The 100[/red] best Dutch [blue]websites (free participation):[/blue]
    : :-) http://www.top100nederland.tk/
    :

    Hi Roderick!

    Where are you checking the output of strVoornaam ?? If you check at the browser, it is going to repace < with the <. View the source of the HTML, your desired output should have been there. I dont see any problem with the function as such.

    :-) heers,
    Vanith
  • : : Hi, I tried to remove the < and > from a string with this self
    : : written function. But even when the string contains < and > it won't
    : : be replaced.
    : :
    : : What is wrong?
    : :
    : : Function unHTML(dezeString)
    : : dezeString = Replace(dezeString,"<","<")
    : : dezeString = Replace(dezeString,">",">")
    : : dezeString = Replace(dezeString,"'","´")
    : : unHTML = dezeString
    : : End Function
    : :
    : : strVoornaam = unHTML(Request.Form("Voornaam"))
    : :
    : :
    : :
    : : for example: Voornaam = PETE
    : : will still be: Voornaam = PETE
    : : in case of: Voornaam = PETE
    : : [hr]
    : : [red]The 100[/red] best Dutch [blue]websites (free participation):[/blue]
    : : :-) http://www.top100nederland.tk/
    : :
    :
    : Hi Roderick!
    :
    : Where are you checking the output of strVoornaam ?? If you check at the browser, it is going to repace < with the <. View the source of the HTML, your desired output should have been there. I dont see any problem with the function as such.
    :
    : :-) heers,
    : Vanith
    :
    Yes, you're right. I thought the textarea should show the &lt, but it showed <. The source was okay.
    [hr]
    [red]The 100[/red] best Dutch [blue]websites (free participation):[/blue]
    :-) http://www.top100nederland.tk/

  • : :
    : Yes, you're right. I thought the textarea should show the &lt, but it showed <%=Server.HTMLEncode(strVoornam)%>

    :)heers,
    Vanith


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories