dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: function to convert special characters to equivalent HTML SYMBOL

  1. #1
    Join Date
    Jan 2006
    Posts
    3

    Exclamation function to convert special characters to equivalent HTML SYMBOL

    Hi,

    I have a javascript function
    function check(){

    frmPrcHir.hdnFactorId.value = frmPrcHir.hdnFactorId.value + "~" + eval("frmPrcHir.txtFactorId" + eval(i+1)).value;

    }

    This function returns a variable of the below sort
    Easy-fil™ Bottle Adapter, Isoflurane ~ Easy-fil™ Bottle Adapter, Halothane ~
    Easy-fil™ Bottle Adapter, Enflurane .

    Problem is

    I need to convert TM to the coresponding HTML number using javascript

  2. #2
    Join Date
    Dec 2005
    Location
    Queen Creek, AZ
    Posts
    1,564
    you mean it doesn't output ™?
    Design first! Code later!

  3. #3
    Join Date
    Jan 2006
    Posts
    3
    Hi,

    It display TM .But i want it to display with the coresponding HTML ASCII character

  4. #4
    Join Date
    Dec 2005
    Location
    Queen Creek, AZ
    Posts
    1,564
    You mean character code?

    when you write the code to a page, it converts it, so use: & amp; without the space between the ampersand and 'amp', then your code....

    The HTML code for @ is @

    when it gets parsed by the browser the & will be converted to '&' and so the code will display.

    btw: a great reference for codes is http://www.ascii.cl/htmlcodes.htm
    Design first! Code later!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles