can i have a step by step procedure how you do this (format number as decimal points)

  • Profile Image
    giulio12
    Asked on September 25, 2012 at 05:37 AM

    How do you go about this one? http://184.154.13.124/format_number_to_price.html

    I wanted this to incorporate into my forms

    thanks

  • Profile Image
    idarktech
    Answered on September 25, 2012 at 08:17 AM

    Hello,

    Here's what you need to do.

    1. Get your form source code, follow this guide: How to get your Form Source Code

    a. Paste this code to notepad or any other HTML editing tools you have.

    b. Add this script on top of the codes: http://pastie.org/4797051 and replaceinput_1 (you'll find it on this code) to your form text box input ID (a text box where you want to apply this decimal function). To get your text box input ID, check this screen. If you're familiar with inspect element, that would help.

    c. After changing the field ID, append this code on the text box html code onchange="Update();". Example:

    <input type="text" class="form-textbox" id="input_1" name="q1_value1" size="20" onchange="Update();/>

    2. Embed your code or save it as HTML file.

    If you can provide your form URL and point to us the field where you'd like to apply this function maybe we can help you better.

    If you need further clarification, please feel free to let us know. Thanks!

  • Profile Image
    idarktech
    Answered on September 25, 2012 at 08:20 AM

    Sorry, I just updated the link for How to get your Form Source Code. Thanks!

  • Profile Image
    idarktech
    Answered on September 25, 2012 at 09:11 AM

    I forgot to mention, you should also change form_22276198814360 this form ID (highlighted in red) to your form ID. So if your form ID is 1234567890, result should be form_1234567890. You'll find this at the bottom part of the script code. Example:

     

    function Update()  {

      var s = new String();

      s = CurrencyFormatted(document.form_22276198814360.input_1.value);

      s = CommaFormatted(s);

      document.form_22276198814360.input_1.value = s;

    So the changes are,

    1. The long string numbers (highlighted in red) to your form ID,

    2. input_1 (highlighted in green) to your text box input ID.

    That's it. If you have further questions, please let us know. Thanks!