Jump to content


  • Posts

  • Joined

  • Last visited

Recent Profile Visitors

175 profile views

BillW's Achievements


Newbie (1/14)



  1. CooperBackpack, This issue is now closed. I just received a solution from the MAS5 team. Their solution is shown below. This is WAYYY more complex an issue then I thought. I thank you so much for your efforts. Bill Winkel <script> function getUrlVars() { const vars = []; let hash; const hashes = window.location.href .slice(window.location.href.indexOf("?") + 1) .split("&"); for (var i = 0; i < hashes.length; i++) { hash = hashes[i].split("="); hash[1] = unescape(hash[1]); vars.push(hash[0]); vars[hash[0]] = hash[1]; } return vars; } function getUrlVar(key) { return getUrlVars()[key]; } </script> <script> function waitForElements(options) { return function wait() { const $elements = document.querySelectorAll(options.selector); if ( $elements.length < options.expectedLength || !options.onverify($elements, options.expectedLength) ) { options.onwait($elements); window.requestAnimationFrame(waitForElements(options)); } else { // Do something with $elements --> options.onload($elements); } }; } function isFormFieldNotEmpty($element) { return !["", " ", "&nbsp;"].includes($element.value); } function verifyDateDue(verifier) { return ($elements, expectedLength) => Array.from($elements) .map(verifier) .reduce((accumulator, current) => accumulator && current, {}); } function handleInlineEdit(options) { waitForElements({ selector: `${options.root} ${options.field.type}[name^="InlineEdit${options.field.name}"]`, expectedLength: 1, onverify: verifyDateDue(isFormFieldNotEmpty), onwait: function ($elements) {}, onload: function ($elements) { // TODO: Add your code here --> options.field.onload($elements); }, })(); } </script> <script> function handleEditClick(event) { handleInlineEdit({ root: "", field: { name: "Date_Due", type: "input", onload: ($elements) => { const dateDue = $elements[0]; dateDue.dataset.cbPreviousValue = dateDue.value; dateDue.removeEventListener("change", myFunction); dateDue.addEventListener("change", myFunction); }, }, }); } document.addEventListener("DataPageReady", (event) => { if (event.detail.appKey === "[@cbAppKey]") { const editLinks = Array.from( document.querySelectorAll('a[data-cb-name="InlineEdit"]') ); editLinks.forEach((link) => { if (!link) { return false; } link.removeEventListener("click", handleEditClick); link.addEventListener("click", handleEditClick); }); } }); function myFunction(event) { if (event.target.dataset.cbPreviousValue !== event.target.value) { //alert("The change event occurred."); } const dateDueChanged = document.querySelectorAll( 'input[name="InlineEditDate_Due_Changed"]' )[0]; dateDueChanged.value = event.target.dataset.cbPreviousValue !== event.target.value ? "Y" : ""; dateDueChanged.checked = event.target.dataset.cbPreviousValue !== event.target.value; } </script>
  2. CooperBackpack, I have tried both of the code changes you recommended and both produce the same 'null' result. I have attached a file that shows the console error. The software is still hanging up as it attempts to read the value of the 'Date_Due' Yes/No data element. Screen Shot(4).docx
  3. I have a tabular datapage with one field (Date_Due) that I'm attempting to monitor for a change in value. When a change is detected, I wish to set the value of a second Yes/No field (Date_Due_Changed) to Yes. I can't seem to read any value except for null. <script> document.addEventListener('DataPageReady', function() { document.getElementById("EditRecordDate_Due").addEventListener('change', function() { alert("Date Due has been changed"); document.getElementById("EditRecordDate_Due_Changed").value = "Yes"; }); // end of change event listener }); // end of DataPageReady event listener </script>
  4. I created a file that explains an issue that has permanently destroyed the functionality of cascading dropdowns on a Details datapage. However, I'm unable to upload that file due to size limitations here. The file can be accessed via Ticket #: 36974. The issue is associated with implementing (via button press) the statement "location.reload()". W3Schools says this is supposed to act the same as the browser's reload function; however, it has corrupted my cascading dropdown boxes to the point where they no longer properly display items within the item list box. The real issue is that I have removed the code, but cannot retrieve functionality of the dropdowns even when I deleted the affected dropdowns and reinsert them into the datapage. Sincerely, BillW
  5. CoopperBackpack, Thank you VERY much. Your recommendation to add the index did the job. Thank you for this advice and for providing the rationale as to why the index was needed. I learned a lesson. Have a great day and stay safe. Bill var span = document.getElementsByClassName("close")[0];
  6. Hi CoopperBackpack, I did as you recommended and the image opened perfectly; however, now I can't 'close' the image. Once again, the image opens and closes perfectly when I execute outside the caspio bridge. I have moved the var span and associated function above the footer, but it didn't make a difference. There are no console errors generated, so I have no idea what to try next. Any suggestions??? Thank you, Bill
  7. Hi again, I apologize for not getting back to you. I was working on another portion of coding and forgot all about this issue. The DP datapage URL: https://c0dci914.caspio.com/dp/98d580004b58a064986e45ef852b Authentication: none Login Support: enabled for one week starting 8/21/2020, 7:30AM EST Dependencies: 1) Select 'R49' from the Job No dropdown 2) enter '0.004' into the Fan field Thank you, Bill
  8. Sandy, Thank you for your prompt response. I did as you suggested and the listener worked fine. However, I had to change the field type within the datapage to a dropdown as opposed to a radiobox as referencing radiobox elements using 'InsertRecordfieldnameX' was recognized as null.
  9. Hi, The attached file provides the workflow definition for an issue I'm having trying to use the value of a dropdown within an event listener. The datapage is a submission form Thank you for your help Bill Event Listener.docx
  10. Hi, The attached WORD file provides the details related to a problem that I have opening an image from a submission form. I have also attached an .htm file that contains the Header contents from the affected data page. The mysterious thing is that the code works perfectly when launched from the .htm file, but not when executed via the caspio server. Please take a look to see what I'm missing.... Sincerely, Bill W. Open Modal Image Error.docx Updated W3 Modal Function.htm
  11. Hi, The attached files provide the details associated with a workflow where I'm attempting to open a data page as a result of a button press. The issue stems from defining a "var = Job_No" that retrieves the parameter's value from a dropdown during the initial record Search. The workflow attached defines an issue opening a tabular data page from a button press on another tabular data page. This workflow is also very similar to the caspio solution. In this case, I'm attempting to get the value of the Job_No parameter based upon entering the value from a dropdown box as part of the initial record search. Display Tabular Data Page from Button Press in Tabular Data Page.docx
  12. Hi, The attached file provides the detailed workflow for an application where I wish to dynamically direct workflow based upon the color of a button. The button was created with the <input> tag. Within the <input> tag I define an ID for the button, but can't seem to reference it when I access the button. Thank you, Get button's background color.docx
  13. Hi Again, FYI, I've also tried setting an anchor and using this to set the background color. By using the three combinations below and the one shown in the current code, I can dance all around the field, and change background color, but cannot figure out how to change the background color of the field itself. isi.parentNode.parentNode. isi.parentNode.nextSibling. isi.parentNode.previousSibling.
  14. Hi CoopperBackpack, Thank you for the quick response. Your solution for accessing the value for ODE_labyrinth_Tol is "spot on". However, neither of our solutions for changing background color works. I tried ".backgroundColor" and ".background". This is confusing as I've done what I thought was exactly the same thing to change background color of a numeric field in another submission form. The only difference I can discern is that ODE_Fan_TIR is the 'change' listened for in the addEventListener statement. Updated Code: I inserted an alert within the IF statement to make sure the subtraction was performed properly, then entered a value of fan = 0.004 with tolerance = 0.002. The alert was activated properly; however, I receive no console error nor did the background color change to 'red'. The updated code is shown below:
  15. Hi Vitalikssssss, The field with ID "ODE_Labyrinth_Tol" is the calculated field. Did you mean to say that this code: let tol = document.getElementById("InsertRecordODE_Labyrinth_Tol").value; should be rewritten as let tol = document.getElementById("InsertRecordODE_Labyrinth_Tol").innerHTML;? Regardless, I still receive the same console error message stating cannot read null. Please see below
  • Create New...