Show the currency sign before total field in JavaScript

Home Forums Web Development HTML, JavaScript and CSS Show the currency sign before total field in JavaScript

Tagged: 

This topic contains 0 replies, has 2 voices, and was last updated by  Hirendra Sisodiya 3 years, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #4919

    AdminC
    Member

    I have a html input control that shows the total of some transactions. I am totaling with javaScript and I am able to show the value to it. But I also need to show the dollar sign before the total.

    <input id="btnTotal" type="button" runat="server" value="0" class="btn_60" />.
    I have tried to place a another label to show the dollar but some time the total field should be blank then i will have to hide the dollar sign. Can i anyone suggest me how to do this?

    #4923

    You can use this just after assigning the total to the field:

    document.getElementById("btnTotal").innerHTML = formatCurrency(document.getElementById("btnTotal").innerHTML.replace('$', ''));

    hope it will help.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.