Jump to content

fuller20

Members
  • Posts

    10
  • Joined

  • Last visited

fuller20's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. The error I posted was from a delpoyed version in IE. But now that I try it again within Caspio bridge, I realized it's a different error there. The error I get when running in Caspio is: Line: 605 Error: 'getElementsByTagName(...).1' is null or not an object Here is a screenshot of the error and a sample of what the report the javascript is supposed to be summing from looks like. http://ReportError.gif[/img] It's supposed to be summing column 10 (Plan Comm), but as you can see it's not making it past the above error. It's not even getting to the point of adding the label "total". Thanks for the continued help.
  2. Yes, it is unchecked. There is no details page as well. Not sure if that matters at all. But something has to be the culprit. And I imagine it's something simple since this code is supposed to work in general. Thanks.
  3. hello, Thanks for the response. It is the correct column. It is column 10 starting with 0 as the first column. The column is of format number and there are no nulls in the column. What am I missing here? This can't be such a complex problem. There has to be something small that I'm missing if this code is supposed to work at all. Thanks.
  4. Actually there are 13 columns. Column #10 is the one I'm trying to total. Unfortunately, I can't post the link to where the datapage is because it cotains data I don't want to broadcast to whoever wants to see it. I can answer any questions though, if someone has some suggestions on why I'm getting this error. Thanks.
  5. I changed the 3 on line 39 to a 10 because that's the row I need to total. So the line says, v_rev = cells[10].innerHTML; Here is the whole jscript segment. I'm still at a loss on this so if someone can help me figure out what is wrong I would appreciate it. Thanks. function NumberFormatted(amount,decimal) { if(isNaN(amount)) i = 0.00; else { var v_number = parseFloat(amount); var v_minus = ''; if(v_number < 0) v_minus = '-'; v_number = Math.abs(v_number); v_number = Math.round(v_number*Math.pow(10,decimal)); v_number = v_number/Math.pow(10,decimal); v_numStr = new String(v_number); v_decStr = new String(Math.pow(10,decimal)); if(v_numStr.indexOf(".") < 0) v_numStr = v_numStr + "." + v_decStr.substr(1,v_decStr.length); else v_numStr = v_numStr + v_decStr.substr(1,v_decStr.length); return (v_minus + v_numStr.substr(0,v_numStr.indexOf(".") + decimal + 1)); } } function f_calTotal() { var v_totalRev = 0; var v_rev = 0; var cas_form = document.getElementById("cb_resultTotal"); if (cas_form.getElementsByTagName("table").length > 0) { var cas_rows = cas_form.getElementsByTagName("table")[1].getElementsByTagName("tr"); for(var rowIndex=1; rowIndex < cas_rows.length; rowIndex++) { var cells = cas_rows[rowIndex].getElementsByTagName("td"); /* 1 – change value inside brackets to choose column to calculate sum */ v_rev = cells[10].innerHTML; if ( v_rev != " " && !isNaN(v_rev.substr(1))) v_totalRev = v_totalRev + parseFloat(v_rev); } var v_nrow = cas_rows.length; cas_form.getElementsByTagName("table")[1].insertRow(v_nrow); var o_lastRow = cas_form.getElementsByTagName("table")[1].rows[v_nrow]; o_lastRow.style.background = "#385C7E"; o_lastRow.insertCell(0); o_lastRow.insertCell(1); o_lastRow.insertCell(2); o_lastRow.insertCell(3); o_lastRow.insertCell(4); o_lastRow.insertCell(5); o_lastRow.insertCell(6); o_lastRow.insertCell(7); o_lastRow.insertCell(8); /* 2 – Display the “Total†label (2 lines below) */ var v_colText = o_lastRow.insertCell(9); v_colText.innerHTML = " Total"; var v_colValue = o_lastRow.insertCell(10); /* 3 – Display the result of the calculation (2 lines below) */ v_colValue.innerHTML = " $" + NumberFormatted(v_totalRev,2) + ""; o_lastRow.insertCell(11); o_lastRow.insertCell(12); } } f_calTotal();
  6. Yes, advanced settings and parameters are enabled. Is there something I'm missing in the parameters that would cause the error I'm getting? I know this has to be something simple, I just can't figure out what it is. Thanks in advance for the help.
  7. Ok, I'm very new to adding javascript to caspio data forms. I've tried to insert the javascript outlined in the topic found here: viewtopic.php?f=13&t=12180&p=13937&hilit=sum+column#p13937 But when I try to run it, it does nothing. I've changed the columns to the correct columns in my table. If I uncheck the "disable script debugging" in the options on my browser, I get the error, Line 39: Error: '10.innerHTML' is null or not an object Column 10 is the column I'm trying to sum and it is not null. I've tried to change it to different columns to be sure I have the correct column, but it gives me the same result no matter what. I've tried this on IE7 and IE8. If somone could provide me a solution to this I would greatly appreciate it. Totalling columns is something I will need to do a lot of. Thanks.
  8. Ok, I figured out kind of a work around to what I wanted to do. In the example above, I just used Price as the field to display for a cascading dropdown for Profit. So it displays the price, but puts the profit in to the table. This will work for now. Thanks.
  9. I don't know if that accomplishes what I need or not. Maybe I should make my question a little clearer. Here's a simplified example of what I'm trying to do. Say I have two tables. Table 1 is a list of fruits and vegetables. In that table are 4 fields: Field 1 is simply Fruit or Vegetable, Field 2 is the Name of that particular Fruit or Vegetable and Field 3 is the price and Field 4 is the profit. Table2 is a Customer Database that will store the 4 fields from above plus the Customers Name. It is empty until we start populating it. I then create a Webform with a textbox for the Customers Name, and cascading dropdowns for Fields 1 and 2 above. So when they select Fruit it only brings up the Fruits, and the same for Vegetables. The problem is, I need to put the profit for the selected item into Table2 without displaying it on the screen. If I use another cascading dropdown, it's no problem at all because there is only one item in the dropdown. But since I don't want the Customer to see profit, I can't display it. I guess what I would need is a hidden field that can be a child or cascading, but that's not a built in option. So given the info above, is the solution still the same? Is there a simple way to do this in javascript (relatively new to that as well). Thank you.
  10. I'm a very new Caspio user and I think I have a pretty simple one for anyone with any experience. \ First I have a view that relates two different tables. Table1 is the data I want to narrow down based on choices made in a webform. Table2 will be the data created based on those choices. So I created a webform with 4 cascading dropdowns. The user makes a choice on the first drop down, which narrows the second drop down, which narrows the 3rd, which gives the user the drilled down list to choose from in the 4th. When the user makes the selection on the 4th drop down, they have narrowed the list down to one row in the table. From this choice I need to populate Table2 with the corresponding row of data in Table1, but I don't want to show the rest of the data on the screen. I know this has to be a simple thing to do, but I can't seem to figure it out. Someone please give a newbie a little enlightenment. Thanks.
×
×
  • Create New...