Announcement

Collapse
No announcement yet.

How do you display characters without the browser converting

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    How do you display characters without the browser converting

    I would like to display a character sequence ">" in a text box on a web page form. When I send it (e.g. <input type='text' value='>'> ) it shows up on the browser as a ">" and when the form is submitted it is now a ">" rather than the string ">". How do I defeat the server/browser encode and decode functions so my data in the text box is handled literally rather than as HTML?

    #2
    Look up html-encode. I think , although I haven't used it in a while, it should do what your looking to do.

    http://www.devguru.com/Technologies/...tmlencode.html

    -Rupp
    ...One Nation Under GOD, Indivisible, With Liberty And Justice For All.
    💁‍♂️ Support & Customer Service 🙋‍♂️ Sales Questions 🛒 Shop HomeSeer Products

    Comment


      #3
      Rupp,
      Nice lead but does not work as desired using homeseer's Server object. It works well under IIS, however neither homeseer or IIS work as described on your reference site.

      Homeseer delivers the literal > to the text box and browser displays it as ">". This is the behavior your reference indicates. However, when the form is submitted the > is read as a ">" and if this value is output again to the form, or written to a file it shows up as ">".

      IIS converts the > into > which shows up on the browser as ">". This is really what I would like to see, however it is not as described in your reference. When the form is returned the > is converted back to > which is what I would expect and want.

      I've done a javascript function to perform this encoding on the client side in the past, but then I was only submitting selective fields and I had control to transform each field as the form was sumbitted. It would be a big bother to do that in this case where I'm using the post method and I have a large grid of text boxes to return.

      What I think will work for me is the following expression. I'll try it for awhile to see if there are some side effects. It seems to create behavior similiar to that provided by IIS.

      Whatever I do to try to past the code here it converts it to html. In essence it is a replace function that replaces all ampersands with ampersand follwed by amp;

      [This message was edited by Michael McSharry on Friday, 20 September 2002 at 12:48 AM.]

      Comment

      Working...
      X