Jump to content

ezIQchad

Caspio Guru
  • Content Count

    238
  • Joined

  • Last visited

  • Days Won

    32

Reputation Activity

  1. Like
    ezIQchad 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.
  2. Like
    ezIQchad 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
  3. Like
    ezIQchad 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.
  4. Like
    ezIQchad 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)
  5. Like
    ezIQchad 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.
  6. Like
    ezIQchad 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>  
  7. Like
    ezIQchad 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.
  8. Like
    ezIQchad 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">  
  9. Like
    ezIQchad 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>  
  10. Like
    ezIQchad 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;
  11. Like
    ezIQchad reacted to logistics in Outer box line and space below outer box   
    Thank you so much! That did the trick
  12. Like
    ezIQchad got a reaction from logistics in Outer box line and space below outer box   
    On the element "table[data-cb-name="cbTable"]" there are two styles you can remove
    box-shadow: rgb(0, 0, 0) 0px 0px 0px 6px
    and
    margin: 10px 80px 80px
     
    If you can't find where these styles originate from in Caspio Styles, add to "user-defined styles"
    CSS
    table[data-cb-name="cbTable"] { box-shadow: none; margin: 0 auto; }  
  13. Like
    ezIQchad reacted to GoCubbies in Is it possible to have javascript to get data from a virtual field which has the form element cascading text field   
    Hello Jonathan,
    Try something like this: var x = document.getElementsByName("cbParamVirtual1")[0].value;
    You may want to take a look at the post on Caspio Form Elements for more references as well.
  14. Like
    ezIQchad got a reaction from aam82 in Caspio Param [@cbUserAgentString]   
    Found a solution
    http://www.useragentstring.com/
  15. Like
    ezIQchad got a reaction from JEllington in How Do You Make A Dropdown (From A Search Page) Filter A Results Page Without Pressing Search Button?   
    Try Faking the Click
    CSS to hide the search button #searchID { display: none; } JS to click the hidden button document.getElementById('dropdownID').onchange = function(){ document.getElementById('searchID').click(); }
  16. Like
    ezIQchad got a reaction from skauntey 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)
  17. Like
    ezIQchad reacted to svitlanataran in Data Usage Thoughts, Tools, Tactics   
    If you want to have all the styles in one place as in your external CSS file you need to define the styles within your CSS file using the embedded HTML tags. Example:

    To define font-family for Caspio label you should look for the element tag on the web page (In Firefox you can install Firebug add-on to easily see the page elements without going into the source), so after you find the element tag which in the label case is "label" then you can write this code in your CSS:

    #caspioform label{
    font-family:Arial;
    }

    So basically .cbFormLabel class is not recognizable in your CSS file. This class is defined in Caspio Style object so when you embed a DataPage using this Style object, Caspio server compiles and converts these styles into inline styles and deliver it to the web page browser. That is why if you remove these classes within the Caspio Style, you need to define your own styles in the CSS for each Caspio element as explained in the example above.
     
    And I don't think, this will reduce data transfer.
  18. Like
    ezIQchad got a reaction from aam82 in Filter And Sort - Two Different Fields   
    Append the following query to the link that opens this page
    ?CPIsortType=asc&CPIorderby=FIELD_NAME Use the DatePage wizard to sort DESCENDING on PrimaryID and limit records returned.
    Then sort using a URL query with the above code.
  19. Like
    ezIQchad got a reaction from svitlanataran 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.
  20. Like
    ezIQchad reacted to jamesguffey3 in Multiple Fields in a Dropdown   
    I would like to be able to have multiple fields appear in a dropdown list. Currently, I have a dropdown on a datapage that displays a last name from another table. I would like for it to display a first and last name in that dropdown. Is there a way to do this?
    -Jim
  21. Like
    ezIQchad got a reaction from sophietheand in Data Usage Thoughts, Tools, Tactics   
    Hi All,
    I had a great conversation with Caspio support a few weeks ago that helped my significantly reduce the amount of data that my app uses.
     
    Here are the cliff notes.
    To see how much data your pages use, paste the URL from the deploy menu into a new web browser, and use a development tool or web inspector to investigate. (in Chrome press F12, and click the Network tab) Records per page is a big factor in data usage... nearly a linear relationship. Ajax is a big load up front, but will help if you encounter many "paging" actions... long reports. Happy Building
  22. Like
    ezIQchad got a reaction from skauntey in Data Usage Thoughts, Tools, Tactics   
    Hi All,
    I had a great conversation with Caspio support a few weeks ago that helped my significantly reduce the amount of data that my app uses.
     
    Here are the cliff notes.
    To see how much data your pages use, paste the URL from the deploy menu into a new web browser, and use a development tool or web inspector to investigate. (in Chrome press F12, and click the Network tab) Records per page is a big factor in data usage... nearly a linear relationship. Ajax is a big load up front, but will help if you encounter many "paging" actions... long reports. Happy Building
  23. Like
    ezIQchad got a reaction from peterhanse in Data Usage Thoughts, Tools, Tactics   
    Hi All,
    I had a great conversation with Caspio support a few weeks ago that helped my significantly reduce the amount of data that my app uses.
     
    Here are the cliff notes.
    To see how much data your pages use, paste the URL from the deploy menu into a new web browser, and use a development tool or web inspector to investigate. (in Chrome press F12, and click the Network tab) Records per page is a big factor in data usage... nearly a linear relationship. Ajax is a big load up front, but will help if you encounter many "paging" actions... long reports. Happy Building
  24. Like
    ezIQchad got a reaction from svitlanataran in Data Usage Thoughts, Tools, Tactics   
    Hi All,
    I had a great conversation with Caspio support a few weeks ago that helped my significantly reduce the amount of data that my app uses.
     
    Here are the cliff notes.
    To see how much data your pages use, paste the URL from the deploy menu into a new web browser, and use a development tool or web inspector to investigate. (in Chrome press F12, and click the Network tab) Records per page is a big factor in data usage... nearly a linear relationship. Ajax is a big load up front, but will help if you encounter many "paging" actions... long reports. Happy Building
  25. Like
    ezIQchad got a reaction from peterhanse in Dynamically Delete All Records In A Table   
    I think you'll need to cycle through the records and delete them one at a time. You can build an auto deleting details DataPage that will do this for you.
     
     
    based on-> http://forums.caspio.com/index.php/topic/4314-js-auto-submit-a-datapage/ with some changes
    <script type="text/javascript"> if(document.getElementById("caspioform")) { document.getElementById("caspioform").style.display = 'none'; setTimeout('document.getElementById('Mod0DeleteRecord').click()',300); } </script> Destination after record update "Go to the next record"
×
×
  • Create New...