Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Javascript escape problem

  • 14-09-2006 11:31am
    #1
    Registered Users, Registered Users 2 Posts: 4,099 ✭✭✭


    I've got a javascript calculator that updates input fields on the page. My problem is that i cant get it to print the euro symbol properly to the input field. Here's basically what i've got:
    <input type="text" name="total" id="total" readonly="true" class="showamount" />
    
    totalField.value = "&euro;" + total;
    
    What happens is that the euro code is escaped resulting in something like "€100" instead of "€100". I've tried using the unescape function but it doesn't make any difference.

    I know the first thing you'll probably say is to just hardcode the euro symbol outside the text box, but for display reasons this isn't an option.

    I'm sure i'm just overlooking something simple, can anyone shed any light?


Comments

  • Registered Users, Registered Users 2 Posts: 26 ast


    You could (and probably have to) use the unicode escapes for the euro symbol.
    totalField.value = "\u20AC" + total;
    


  • Registered Users, Registered Users 2 Posts: 4,099 ✭✭✭muckwarrior


    That done the trick, cheers.


Advertisement