deneme bonusu maltcasino bahis siteleri
sex video free download in mobile hot sexy naked indian girls download free xxx video
antalya escort
atasehir eskort bahcelievler escort alanya escort atasehir escort
gaziantep escort
gaziantep escort
escort pendik
erotik film izle Rus escort gaziantep rus escort
vdcasino casino metropol casinomaxi
beylikdüzü escort
deneme bonusu veren siteler deneme bonusu veren siteler
z library books naked ai
deneme bonusu veren siteler
deneme bonusu veren siteler
bahis siteleri
sweet bonanza
casino siteleri
en iyi casino siteleri
deneme bonusu veren siteler
casibom
s
Contact Login Register
h M

Data Springs Modules Community Questions & Answers

Calculate CheckBoxes with Search Implemented

Hi, I have a dynamic view set up with a HTML table template. Table includes textboxes which hold values that can be changed and checkboxes that sum the textboxes in the footer of the table when they're checked. The problem is that the JavaScript function I use doesn't work when the search feature is implemented.
This is the JavaScript function I used:

function UpdateCost() {
      var sum = 0;
      var gn, elem, gm, elemcb;
      var checkboxes = document.getElementsByName('ApprPmtCB');
      var n = checkboxes.length;
      var i;
      for (i=1; i<n; i++) {
           gn = 'CB_'+i;
           gm = 'CBC_'+i;
           elemcb = document.getElementById(gm);
           elem = document.getElementById(gn);
           if (elemcb.checked == true) { sum += Number(elem.value); }
           }
      document.getElementById('GrandTotal').innerHTML = sum.toFixed(2);
}
window.onload=UpdateCost;

 

All of the checkboxes in the table have the name 'ApprPmtCB' and id = 'CB_[rownumber]'. The textboxes have id='CBC_[rownumber]'. I'm thinking the problem is that when the search is done, the first checkbox id is not longer CB_1 but it becomes a number larger than one so the JavaScript loop doesn't start. Is there is anyway around this? Or another function I could implement?

I'd appreciate any help I can get. Thanks!

Dynamic Views Version: 4.0.1
DNN Version: 7

asked 8/8/2014
23

1 Answer

Hello,

I would highly recommend implementing JavaScript atements all throughout your JavaScript function. This way you can step through and understand the values of each variable.

This should assist you in finding when this breaks, or no longer works. You may want to implement a try / catch around some of your DOM references just in case it doesn't exist.

After completing some additional debugging, let me know your findings.

-Ryan
answered 8/8/2014 Rbakerink 160
Rbakerink

Your Answer

In order to provide an answer to this question, you must Login

I am flagging this question because...




10 inform moderator flags remaining

I am deleting this question because...




I am flagging this answer because...




10 inform moderator flags remaining

Flagging a Post

You have already flagged this post. Clicking "Remove Flag" below will remove your flag, thus reducing the count by one as well.

I am deleting this answer because...




Looking for a DNN Module?

If you’ve used Data Springs modules before, you know how easy they are to install and use. We have built each individual module in our collection with integration in mind, so when you opt for Collection 7.0 you’ll be able to install our entire toolbox quickly and start putting it to work for your business today.Yes, in the blink of an eye you will arrive on the scene like a Superhero!

Data Springs has long been recognized as a leader in the DotNetNuke (DNN) community through hard work, integrity, and commitment. We’ve helped thousands of people POWER UP their website and our Collection 7.0 will do the same for you.

You deserve more than just an average website. You deserve a MACHINE!

Enter your email below AND grab your spot in our big giveaway!

The winner will receive the entire Data Springs Collection 7.0 - Designed to get your website up and running like a DNN superhero (spandex not included).

  
Subscribe