[nfbcs] trying to make a smart page

Aaron Cannon cannona at fireantproductions.com
Thu Jan 15 15:21:08 UTC 2015


Can you use JQuery? If so, it would certainly make it much easier. Well, maybe not much easier, but relatively easier

--
This message was sent from a mobile device


> On Jan 15, 2015, at 08:56, Stanzel, Susan - FSA, Kansas City, MO via nfbcs <nfbcs at nfbnet.org> wrote:
> 
> Good morning Listers,
> 
> I am sending this to both lists. I have been asked to try to get this working. They want to add numbers together keeping track of the running total. I am using Windows7, IE9, and JAWS 15. Any assistance will be greatly appreciated. It works better in FireFox, but our default browser is IE. I know how to read HTML and JavaScript, but I am not very knowledgible on writing it. The code follows my name.
> 
> Susie
> 
> <!DOCTYPE  html>
> <html>
>       <head>
>              <title>Output test</title>
>       </head>
>       <body>
>              <form method="post" action="#">
>                     <label for="input1Id">Input 1:</label>
>                     <input id="input1Id" aria-controls="outputId" type="text">
>                     <br>
>                     <label for="input2Id">Input 2:</label>
>                     <input id="input2Id" type="text" aria-controls="outputId" >
>                     <br>
>                     <label for="input3Id">Input 3:</label>
>                     <input id="input3Id" type="text" aria-controls="outputId">
>                     <hr>
>                     <div aria-live="polite" aria-atomic="true" role="region"
> aria-labelledby="Result">
> 
>                     <span id="sumLabel">Sum: </span>
>                     <span id="outputId" >
>                     </span>
>                     </div>
>              </form>
>              <script type="text/javascript">
>                     var inputIds = ["input1Id", "input2Id", "input3Id"];
>                     function handleBlur()
>                     {
>                           var output = document.getElementById("outputId");
>                           var sum = 0;
>                           for (var i = 0; i < inputIds.length; i++)
>                           {
>                                  var inputId = inputIds[i];
>                                  var input = document.getElementById(inputId);
>                                  var value = parseInt(input.value, 10);
>                                  if (! isNaN(value))
>                                  {
>                                         sum += value;
>                                  }
>                           }
>                           output.removeChild(output.firstChild);
>                           var text = document.createTextNode(sum);
>                           output.appendChild(text);
>                     }
> 
> 
> 
>                     var inputs = document.getElementsByTagName("input");
>                     for (var i = 0; i < inputs.length; i++)
>                     {
>                           inputs[i].addEventListener("blur", handleBlur);
> 
>                     }
>                     document.getElementById("input1Id").focus();
>              </script>
> </html
> 
> 
> 
> 
> This electronic message contains information generated by the USDA solely for the intended recipients. Any unauthorized interception of this message or the use or disclosure of the information it contains may violate the law and subject the violator to civil or criminal penalties. If you believe you have received this message in error, please notify the sender and delete the email immediately.
> _______________________________________________
> nfbcs mailing list
> nfbcs at nfbnet.org
> http://nfbnet.org/mailman/listinfo/nfbcs_nfbnet.org
> To unsubscribe, change your list options or get your account info for nfbcs:
> http://nfbnet.org/mailman/options/nfbcs_nfbnet.org/cannona%40fireantproductions.com




More information about the NFBCS mailing list