Jump to content

LWSChad

Caspio Rockstar
  • Posts

    259
  • Joined

  • Last visited

  • Days Won

    34

Reputation Activity

  1. Like
    LWSChad got a reaction from kpcollier in Send Email With Login Instructions   
    It will take a couple Data Pages and a couple new fields in your user table.
    Confirmation code field unique is required random isn't exactly required, but it shouldn't be predictable  Confirmation status field i.e. if confirmation_status !== 'confirmed' { do not allow login } An update Data Page to send the email with a link to the confirmation Data Page, set confirmation status to something like sent or pending, and add a unique value to the confirmation code field. Another update Data Page where the email will link members to that filters the user table by email and confirms the followed the magic link using the confirmation code. This Data Page would update confirmation status to "confirmed" Boom
     
    Hope this helps
  2. Like
    LWSChad got a reaction from RandyBass in Send Email With Login Instructions   
    It will take a couple Data Pages and a couple new fields in your user table.
    Confirmation code field unique is required random isn't exactly required, but it shouldn't be predictable  Confirmation status field i.e. if confirmation_status !== 'confirmed' { do not allow login } An update Data Page to send the email with a link to the confirmation Data Page, set confirmation status to something like sent or pending, and add a unique value to the confirmation code field. Another update Data Page where the email will link members to that filters the user table by email and confirms the followed the magic link using the confirmation code. This Data Page would update confirmation status to "confirmed" Boom
     
    Hope this helps
  3. Like
    LWSChad got a reaction from MarcG in Using an HTML page with 2 DataPages, page inspector shows 3 id="caspioform"; can the IDs be changed?   
    Unfortunately, I haven't figured out how to change them... without breaking things.

    Two work arounds that I use...
    Iframes I use iframes in most of my Caspio applications that rely on DataPages. <form id="caspioform" ... is not the only duplicated ID. Buttons and fields common to both data pages are also duplicated. Iframes let each data page be the only one in the page. Containers Simply putting the data pages into containers can help with this. <div class="dp-container" id="dp-1"> <script type="text/javascript" src="https://*******.caspio.com/dp/12345***************/emb"></script> </div> <div class="dp-container" id="dp-2"> <script type="text/javascript" src="https://*******.caspio.com/dp/12789***************/emb"></script> </div>  
    This approach won't stop the error for non-unique ids, but you can now at least identify the elements accurately. const form1 = document.querySelector('#dp1 #caspioform'); const form2 = document.querySelector('#dp2 #caspioform');  
    Hopefully this helps!
  4. Like
    LWSChad reacted to MarcG in Using an HTML page with 2 DataPages, page inspector shows 3 id="caspioform"; can the IDs be changed?   
    I am using two different divs, but I haven't tried a specific container. Thank you! This helps a lot.
  5. Like
    LWSChad got a reaction from jpowell in Caspio Bridge user accounts not working   
    I am experiencing this in one of the five accounts I work in.
    My experience is slightly different than your description as after about 3 minutes the objects would load and it was not all objects. Data Page editor, app parameters, and table design were all that I can recall.

    Support knows about this and I would assume are working hard to resolve it - not a minor thing.
  6. Like
    LWSChad reacted to Joemac in Taking a picture with iPad and attach to record   
    @kpcollier thanks for the recommendation.  @LWSChad Can I contract you to do this for me? 
  7. Like
    LWSChad reacted to kpcollier in Taking a picture with iPad and attach to record   
    No, I apologize. Between school and my job I do not have time. However, I'll gladly help you here for free. 
    I would recommend @LWSChad if you really need someone else to do this for you. He has helped me a few times on these forums and I know he recently got the Certified Caspio Developer stuff going on. 
  8. Like
    LWSChad reacted to GoodBoy in External account users edit DataPage access permission   
    I also experienced this issue a last month. What I did is that I also allow or checked the 'Read App' for the application where my DataPage belongs and it is now permitting my external users to access the DataPage.
  9. Like
    LWSChad reacted to RuisiHansamu in External account users edit DataPage access permission   
    Hi @LWSChad - if you want your users to have a capability to edit your DataPage or application, you may want to check the the user's permission located inside your Caspio Bridge account. Just simply go to Account > Access Permission > Users > Permissions. Then, you can now choose what Application, DataPage, Table they can have control with. I learned this step by step with Caspio's Helpful video overview here. If you are the account owner then you can easily do this and follow the steps. I also used these documentations below: 

    https://howto.caspio.com/managing-your-account/internal-users-groups-and-api-profiles/managing-permissions/
    https://howto.caspio.com/managing-your-account/internal-users-groups-and-api-profiles/account-users-groups-and-api-profiles/
    https://howto.caspio.com/managing-your-account/internal-users-groups-and-api-profiles/inviting-new-account-users/
    Cheers mate!  
     
     
  10. Like
    LWSChad reacted to Gillian in Dev > Test > Prod best practice   
    Hello fellow Caspio-ers
    Has anyone come up with any clever ideas of ring-fencing development work from deployed, production datapages.
    I get nervous when I need to make changes to a table or view when the related data pages are in use.
    Thanks
    Gill
  11. Like
    LWSChad reacted to fundy in Using User Cookies For REST API Calls   
    Hello Caspio Community! 
    Let me explaining my scenario firstly please.
    Currently I'm stuck on how to authenticate REST API calls in a secure manner. I have a new app stood up and ready to launch (this app is/well always be locked behind Caspio Login) . However, before I launch  this app I was wondering if I could use "document.cookie()" user token to make API calls instead of the bearer token that I have been using for development.   If I could use a user token instead of an API key I would feel much more secure. 
     
    Thank you for taking time out of your day to read this! I look forward to reading your replies!
  12. Like
    LWSChad reacted to kpcollier in Cascading Dropdown Value And Source Values   
    Hello,
    I am trying to make a cascading dropdown field that receives the value from the parent field selection and still have the rest of the values from the dropdown source show along with it. Sort of like the option 'Match all when blank' but I want to match all - all the time, and populate the dropdown with the cascading value. 
    I am building a scheduling calendar. We take information from our Work Order Table to use for creating records for the Scheduling Table. Each Work Order record has a technician assigned. When a work order is selected in the Scheduling Submission Form, the Technician field is populated. However, I need to be able to change this value for the Scheduling Table if needed. I need our scheduler to be able to select a work order, have the technician field populate, and have the ability to change the value.
    Is it possible to have the Technician field be a regular dropdown with all of the values from the datasource, and then use javascript to prefill the value? Maybe, use a virtual field to get the cascading value, and then use JS to select the value in the tech dropdown? I have the virtual field set up, but if someone could help me out with the javascript, that would be appreciated!
  13. Thanks
    LWSChad got a reaction from kpcollier in Cascading Dropdown Value And Source Values   
    Hi @kpcollier,
    Choosing a specific value from a dropdown can be achieve with a bit of javascript.
    First, identify the dropdown element and create an array the represents the dropdown choices:
    const dropdownEle = document.querySelector('[name*=field_name]'); const dropdownChoices = dropdownEle.options; Next, create the makeSelection function:
    function makeSelection(selectionID) {   // loop all the dropdown options   for(let i = 0; i < dropdownChoices.length; i++) {     // if the dropdownChoice matches the selectionID...     if(dropdownChoices[i].value == selectionID) {       // select the choice by the index number       dropdownEle.selectedIndex = i;     }   } } Then, identify the cascading textfield and set it's onchange event to trigger the makeSelection function:
    const vEle = document.querySelector('[name=cbParamVirtual1]'); vEle.onchange = function() { makeSelection(vEle.value); };  
    I hope this helps
  14. Thanks
    LWSChad reacted to TellMeWhy in Dropdown for Color Choice   
    ahh, I don't know, I believe only radio buttons accept images
     

     
    use img tag for the display . i.e. <img src="https://multimedia.3m.com/mws/media/1484762F/3630-61-slategray-swatch.jpg" alt="test" width="50px"/>

  15. Thanks
    LWSChad got a reaction from kpcollier in Auto-Submit Search Form When Parameters Received   
    Hi @kpcollier
    Then a bit of javascript to check for the parameter.
    <script> var p = '[@your_parameter]'; if(p !== '') { console.log('parameter present - auto search'); yourAutoSubmitFunction(); } else { console.log('no parameter - behave normally'); } </script> Pair this with the AutoSubmit described here (and that you mentioned)
     
    To prevent a loop, reset Caspio parameters with (cbResetParam=1  on the link back to search.
    Search form URL: /your-search-page.html?cbResetParam=1 I hope this helps

  16. Like
    LWSChad reacted to brunor in Any Programmers for Hire   
    Working with Chad (ezIQ) was effortless and an absolute pleasure. I asked him to figure out a few custom solutions for my Caspio project, and he quickly provided javascript solutions that have functioned beyond my expectations. His code is well organized and includes plenty of comments for the novice, such as myself. I highly recommend his services and look forward to future projects.
  17. Like
    LWSChad reacted to Gutchilimansi in Calc Field (-)   
    Hi ezIQchad,
    You are receiving an error because the Substring function of Caspio doesn't allow a negative value for the length parameter.
    Below are two possible solutions to your issue:
    Solution 1
    Substring( Substring([@field:ScratchPad], Charindex(': ',[@field:ScratchPad], Charindex('Departure Airport: ',[@field:ScratchPad])) , Charindex('======',[@field:ScratchPad], Charindex(': ',[@field:ScratchPad], Charindex('Departure Airport: ',[@field:ScratchPad]))) - Charindex(': ',[@field:ScratchPad], Charindex('Departure Airport: ',[@field:ScratchPad])) ) ,2,len([@field:ScratchPad]) ) This one uses the same logic as your previous code, only now it has another Substring that encapsulates your whole code.
    Solution 2
    Substring([@field:ScratchPad], (Len('Departure Airport: ') + Charindex('Departure Airport: ', [@field:ScratchPad], 0)), (Charindex('=====', [@field:ScratchPad]) - (Len('Departure Airport: ') + Charindex('Departure Airport: ', [@field:ScratchPad], 0))) ) This second solution acts somewhat like Javascript's slice() method.
     
    Both solutions have been tested using different test data, and it looks like they are both returning the same results.

    Let me know if you have any questions. I hope this helps.
    - G
  18. Like
    LWSChad got a reaction from TWIRED in Id="caspioform" Scroll Height   
    Hello,
    Another formatting trick!
     
    I previously had challenges getting Caspio Forms to scroll properly. Then I learned about viewport in CSS -> https://web-design-weekly.com/2014/11/18/viewport-units-vw-vh-vmin-vmax/
    #caspioform {   overflow: auto;   height: calc(100vh - 96px); } I use calc() to take into account the header. If you use calc the spaces between the values and the operator(-,+,*,/) is required.
  19. Like
    LWSChad got a reaction from Kennylj24 in Passing Parameters Without Refreshing Page   
    Parent and Child are two different web pages.
     
    Parent - lead-info-center.html (excuse my lack of code box, I wanted to highlight things to help explain)
    -------------------------------------------------------
    <body onload="setIframeSource()">
     <div id="frmSummary1" class="licFr">
      <div class="divHeader">
       <h2>Summary</h2>
       <a onclick="window.ifrLeadSummary.location.href = 'lic-leadSummary.html'"></a><!-- refresh button -->
      </div>
      <div id="ifrDiv">
       <iframe name="ifrLeadSummary" class="licIframe" id="ifrLeadSummary"></iframe>
      </div>
     </div>
    <script>
      //set iframe source
      function setIframeSource() {
        varLeadID = getQueryVariable("LeadID");
        document.getElementById('ifrLeadSummary').src = 'lic-leadSummary.html?LeadID='+varLeadID;
      }
    </script>
    ------------------------------
     
     
    child - lic-leadSummary.html
    -------------------------------
    <body>
     <div id="ifr" class="ifrContent">
      <script type="application/javascript" src="https://b5.caspio.com/scripts/e1.js"></script>
      <script type="application/javascript">try{f_cbload("***","http:");}catch(v_e){;}</script>
     </div>
    </body>
    -------------------------------   The child is basically an html file with only the Caspio Deploy code.
     
    If you want a param to come from another iframe, you'll need some way to set the variable.
     
    The example you provided loads an entire second page, but your question seems like you want it all on one page. 
     
    The code above using a URL Query Variable (web-page.html?variable=value) from the page load, but you can get the value of an element and add it to the setIframeSource script. maybe something like...
    <script> //on click, set iframe source document.getElementById('buttonID').onclick = function () { var pSearch = document.getElementById('searchElementID').value; document.getElementById('ifrLeadSummary').src = 'child.html?filterField=' + pSearch; } </script> *********************
    To Build and Test, use alert(someVar); or alert('step1'); throughout your code. It allows you to see what values your variables are set at,,,, and where your code is breaking (when I'm writing something new that is proving challenging, I'll put alert('step[X]'); after every line to dial it in)
  20. Like
    LWSChad got a reaction from TWIRED in User Authentication Counter   
    Yep,
    Set up an AutoSubmit [http://forums.caspio.com/index.php/topic/4314-js-auto-submit-a-datapage/] DataPage that fires after logging in...
     
    Then simply create a report DataPage to display the data however you want.
  21. Like
    LWSChad got a reaction from TWIRED in Param in Caspio JS Snippet (not a question, a cool trick)   
    Check out this amazing trick I learned this morning.
    You can pass params into a datapage by adding the param right into the snippet from Caspio
    <script type="application/javascript"> var someVar = 'abc'; try{f_cbload("****************89c82&tf="+someVar,"https:");}catch(v_e){;} </script> My actual use case <script type="application/javascript"> var htmlFile = location.pathname.substring(location.pathname.lastIndexOf("/") + 1); try{f_cbload("****************89c82&tf="+htmlFile,"https:");}catch(v_e){;} </script>  
  22. Like
    LWSChad got a reaction from MayMusic in Conditional Formatting Trick   
    Check out this trick I stumbled upon.
     
    Put Caspio Variables into your Classes so you can use CSS to dynamically style your pages.
    (js not required)
     
     
    Div to dynamically format 
    <div class="action[@field:action]"></div> css
    .actionCall { background-image: URL("../img/call.png"); } .actionEmail { background-image: URL("../img/email.png"); } .actionText { background-image: URL("../img/text.png"); } Dynamic Elements - load all options, and hide all but needed
    <a class="btnFile fileName[@field:FileName]" href="../some/dir/[@field:FileName]">Download</a> <a class="btnLink fileLink[@field:FileLink]" href="[@field:FileLink]">View File</a> css
    /*-- when [@field:***] is null, hide the div --*/ .fileName, .fileLink { display: none; } Hope this helps
     
    Think Easy
    CHAD
    -I know the Title of this Forum is "Ask....", but IDK where else to share stuff like this.
  23. Like
    LWSChad got a reaction from Mathilda in External Stylesheet   
    Hello,
    This is not a question, but some may find this info useful.
    If you are using an external stylesheet, be sure to load your Caspio javascript prior to the linked CSS file.
    The script should come before
    <script type="text/javascript" src="https://**.caspio.com/scripts/e1.js"></script> the stylesheet
    <link href="style/sk.css" rel="stylesheet" type="text/css">  
  24. Like
    LWSChad got a reaction from peterhanse in autosubmit destination after record update to a specific page ,depending on a value   
    Caspio handles destination upon submit.
    Add the code for the desired redirect to a "Dispaly a Custom Message" option on the "Destination" page in the form editor.
    Then you should be able to simplify your code
    <script> var machtiging = "[@authfield:GEBRUIKERS_Machtiging]"; if(machtiging=="Yes") { window.location="[@app:logout]"; } else { window.location="[@app:horseplanner_home]"; } </script>  
  25. Like
    LWSChad got a reaction from ChristofK in Conditional JavaScript does not seem to get virtual cascading text field value   
    Cascading fields lose their static ID, so if it's a cascading text field the ID will change from "cbParamVirtual12" to something like "cbParamVirtual12_jhdas068fsda0t67f8"
    Try 
    var AMF1 = document.getElementsByName('cbParamVirtual12')[0].value; rather than
    var AMF1 = document.getElementById('cbParamVirtual12')[0].value;
×
×
  • Create New...