What is JotForm?
JotForm is a free online form builder which helps you create online forms without writing a single line of code. No sign-up required.

At JotForm, we want to make sure that you’re getting the online form builder help that you need. Our friendly customer support team is available 24/7.

We believe that if one user has a question, there could be more users who may have the same question. This is why many of our support forum threads are public and available to be searched and viewed. If you’d like help immediately, feel free to search for a similar question, or submit your question or concern.


  • Profile Image

    Need help with general question. Html/Javascript

    Asked by MarkPutt on February 21, 2014 at 11:17 AM

    I downloaded a form to study and work on.   I wanted to duplicate a field.  Here is the field.

     

              <br /><span class="form-payment-total"><b>

                  Total:&nbsp;<span>$<span id="payment_total">0.00</span>

                    USD</span></span>

              </b>

             <br /><span class="form-payment-total"><b>

                  Total:&nbsp;<span>$<span id="payment_total">0.00</span>

                    USD</span></span>

              </b>

     

    When I run the code and view the form the first instance caculates properly.  HOWEVER the identical code in the second instance does not calculate at all.   Why won't the second instance calculate the total as well?

    USD identical all and
  • Profile Image
    JotForm Support

    Answered by EltonCris on February 21, 2014 at 12:01 PM

    Hi,

    Because they both have the same ID. Note that ID should be unique in a HTML page. When you use it twice, any script that calls or use that ID would only take effect on the first one. I think you have to use another script in order to display the same total on the text field if you want to or there might be another solution, maybe using class selector instead of ID would help.

    Just let us know here if we can be of further assistance.

    Regards!

  • Profile Image

    Answered by MarkPutt on February 21, 2014 at 12:03 PM

    LOL.  Thanks. That is obvious.    I just missed that.  Thanks.

  • Profile Image

    Answered by stu  on October 20, 2014 at 06:22 PM

    Mark, did you sort that?... I'm looking to do the same and would be good if you could show me how...