dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Adobe Form Validation

  1. #1
    Join Date
    Oct 2011
    Posts
    2

    Adobe Form Validation

    Help! I need help with a script for an Adobe form I am trying to create. I have multiple fields for the users to enter a percentage. I need a field at the end to validate that the sum of all these fields equal 100. I need it to notify the user when it is under and over.

    For example, happy path would be...

    FIELD A = 25%
    FIELD B = 25%
    FIELD C = 50%
    TOTAL = 100%

    Unhappy path might be...

    FIELD A = 25%
    FIELD B = 25%
    FIELD C = 25%
    TOTAL = 75%... user needs to update one of the other fields so the total adds up to 100%.

    Any help would be awesome! Thanks!

  2. #2
    Join Date
    Oct 2011
    Posts
    2
    I tried using this code...

    <html>
    <head>
    <script type="text/javascript">
    function validateForm()
    {
    Total=document.forms["ressop 2913"]["Total"].value;
    if (Total==100 || Total=="")
    {
    alert("TOTAL MUST EQUAL 100%");
    return false;
    }
    }
    </script>
    </head>

    </html>

    But keep getting a "missing } in xml expression 6: at line 7.

    Any ideas what I'm doing wrong?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles