Jump to content


Caspio Ninja
  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by Elderberg

  1. Hi there, below code runs before the pop-up window loads and renders the field i'm trying to reference. I've tried to use DatapageReady event handler but this doesn't seem to work as I thought it would. alert(document.getElementById("BulkEditDelivery_Status").value); Is there a way to run javascript AFTER the pop-up window loads?
  2. I have the below in the footer of a Pivot Report Drill down. The code runs once upon the first drill down, but when i return to the Pivot and drill down again into another area, the code executes twice, repeating again and it executes 3 time, then 4 times etc, etc. Looking for help on understanding why i'm observing this behaviour.. and how to prevent it. <script> document.addEventListener('DataPageReady', function(event) { alert("hello"); }); </script>
  3. I'm not sure the technical reasons, but is this limit associated with a lower tier plan or across all plans? I'm curious if there is a cost to increase the limit as an add-on or if included in a higher tier plan
  4. I have the below code inserted into an HTML Block. The first line creates a link and passess the parameters to the new page. However, it seems like caspio is not rendering the <form> and </form> and so clicking on the submit button it just refreshes the page. Does anyone have any experience with embedding a form inside html block like this? Ultimately i'm just trying to launch a new page and pass parameters securely. <a href="1045_Report.php?CMPID=[@field:CMP_ID2]&LID=[@field:Codename]&GBL=[@field:GroupByLabel]" target="_blank">RadioCheck</a> <form name="btn1" id="btn1" action="/1045_Report.php" method="post"> <input type="hidden"type="text" id="LID" name="LID" value="COUVA"><br> <input type="hidden" type="text" id="lname" name="lname" value="Doe"><br><br> <input type="submit" name="btn1" id="btn1"value="RadioCheck"> </form>
  5. Is it possible to pass parameters more securely using POST instead of GET?
  6. Is it possible to reference a field from cb_pg1_virtual01 from cb_pg2? I essentially would like to pass a parameter from one datapage to another WITHOUT using a multi-step page.
  7. I too would appreciate the ability to add HTML blocks and calculated fields to pivot tables. I went searching the forums for a solution, and came upon this post.
  8. Just leaving this here ... <script> document.addEventListener('DataPageReady', function(event) { function hideControlsForPerson() { var table = typeof document.getElementsByClassName("cbResultSetTable" + event.detail.uniqueSuffix)[0] == "undefined" ? document.getElementsByClassName("cbResultSetTable")[0] : document.getElementsByClassName("cbResultSetTable" + event.detail.uniqueSuffix)[0]; // Find the index of the last column, which happens to be the inline edit/delete var total_num_columns = table.rows[0].cells.length; var controlsColumnIndex = total_num_columns - 1; //position of the column with inline edit/delete // Find the index position of the column by searching the column's label row = table.rows[0]; var i; var KeyColumnIndex; for (i = 0; i < total_num_columns; i++) { if (row.cells[i].textContent == 'Label_of_Target_Field') { KeyColumnIndex = i; i = total_num_columns; // this is essentially to exit the loop } } // Iterating through rows and hiding Content for (var i = 1, row; row = table.rows[i]; i++) { if (row.cells.length > KeyColumnIndex && row.cells[KeyColumnIndex].textContent !== '[@authfield:Name]') { row.cells[controlsColumnIndex].style = "display:none;" } } } hideControlsForPerson( ); }); </script> Note: " row.cells.length > KeyColumnIndex " was added to the if statement to protect against an uncaught TypeError that happens if using a date rollup or other field grouping.
  9. Hi There, Would it be possible to update this to automatically find the Index for "nameColumnIndex" and "controlsColumnIndex" based on the name of those fields by counting until some condition is met? This would help when we add change the column positions later on so as not to break the code. Thanks in advance
  10. Did some reading and testing.. my solution, isn't perfect, it just submits the last form on a page with multiple forms. Note that this counts ALL forms and not just forms with "caspioform" as the ID. var x = document.forms; x[x.length-1].submit();
  11. I've isolated the issue to when i have 2 data pages.. with the update page being the second one. I think the document.forms["caspioform"].submit() is submitting the first datapage (which is a HTML page). Any ideas.
  12. I've inserted the following into an html block: <input type="button" name="Mod0CancelRecord1" value="CANCEL" class="cbBackButton"> And then in the footer i've inserted: document.getElementsByName('Mod0CancelRecord1')[0].onclick = function(){ if (confirm("Close Window?")) { window.close(); } }; but unfortunately i've discovered : Any ideas or suggestions are welcome
  13. Hi, i've selected Custom option using Totals and Aggregation.. how do I use the Custom option to do summation?
  14. Excellent. thank you. I will give this a try next time. I ended up renaming my fields, it wasn't as time consuming as I thought, but will look into what you've shared in future scenarios.
  15. Hi, See below the code which i've used on a web form submission successfully. I've tested this on the Details page, it seems to work, however, the changes made on the Details page don't get written to the database table. Any advise welcome.. <script> // PREVENT SUBMIT UNLESS VALIDATED document.addEventListener('BeforeFormSubmit', function(event) { event.preventDefault(); //do something before submitting update document.forms["caspioform"].submit(); }); </script>
  16. www.example.com/datapage.asp?cid=D4ITUH2C Is it possible to directly reference the cid value using Javascript?
  17. For benefit of others, the following code works better: // PREVENT SUBMIT UNLESS VALIDATED document.addEventListener('BeforeFormSubmit', function(event) { if (some_condition) { //result if condition is met } else { event.preventDefault() } });
  18. I resolved a way to trigger an onchange event on Field1 programmatically. Once the onchange event is triggered the cascading dropdown refreshes properly. var e = document.querySelector("[id*=cbParamVirtual40]"); e.dispatchEvent(new Event('change'));
  19. I've isolated it to the javascript below which I've used successfully in other datapages. I've stripped away my code and run the form with the below code verbatim. (i.e. the if statement i changed the condition to be "1") and ran the code and experienced the weird issue. I'm totally stumped. <script type="text/javascript"> // PREVENT SUBMIT UNLESS VALIDATED document.addEventListener('BeforeFormSubmit', function(event) { event.preventDefault(); // checks validation rules, only submits if all rules are validated successfully. if (1) { document.forms["caspioform"].submit(); } }); </script>
  20. Upon successful submission I have a message displaying "Your record was successfully updated." However, for some reason now the submission form is repeated below this after successful submission. I notice after the submission the URL has this: ?appSession=8RB87A2G927E83NL92A4 ... I'm not sure why this appSession key is appended to the URL but it seems to be causing the issue. Does anyone have any idea what's going on or tips on where I should start troubleshooting? I tried to check a few places when I edit the datapage but didnt see anything out of the ordinary.
  21. I'm having trouble getting a cascading dropdown to refresh programatically : I have two fields: Field1 (dropdown) and Field2(cascading dropdown), when the page loads I can using javascript set the value of Field1, but the corresponding Field2 does not recalculate. its always stuck filtering off the first item in the Field1 dropdown.
  22. FYI, for benefit of others with similar problem that want to use a single page with the search criteria displayed above the Results. //insert script below into Footer of "Configure Search Fields" <script> document.addEventListener('DataPageReady', function (event) { // Create a new Virtual Field (in my case cbParamVirtual1) for user to enter the search parameter. // The below code will execute when the user updates the Virtual Field and then stamp it into multiple fields. var x10 = document.querySelector('[id=cbParamVirtual1]'); x10.onchange = function() { document.getElementById('Value1_1').value = document.getElementById('cbParamVirtual1').value; document.getElementById('Value2_1').value = document.getElementById('cbParamVirtual1').value; document.getElementById('Value3_1').value = document.getElementById('cbParamVirtual1').value; } }) </script> Also you'll need to edit items under the Logic tab as follows: After you test, you can hide the fields: Value1_1, Value2_1, etc
  • Create New...