Show the currency sign before total field in JavaScript


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

    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?


    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.