Jump to content


Caspio Guru
  • Posts

  • Joined

  • Last visited

  • Days Won


Community Answers

  1. Aurora's post in User Authentication Default for Cascading Dropdown was marked as the answer   
    Hi Robert, 
    You can use dropdown with Custom values and LookUp Table  and use RLS  there. On load you can receive external parameters of the auth field. In this case default value will be the one that you receive as parameter. 
  2. Aurora's post in Date Of Birth Field was marked as the answer   
    Hello seancsn.
    You could receive the following external parameters  [@cbTimestamp*] in the Date Field. 
  3. Aurora's post in Datapage Div Auto Refresh Issue With Authorisation was marked as the answer   
    Hello Monoux. 
    I am afraid you can' refresh you second embedded DataPage and receive cookies of Authenticated fields. This is made due to security in Caspio. 
    However, you could deploy the second DataPage as Iframe and use the following code: 
    !DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title></title> <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.4.min.js"></script> </head> <body> <table style="border: 3px solid red;"> <tr> <td> <a href="YOUR LOGOUT LINK">Logout</a> </td> </tr> <tr> <td> <div id="parent"> EMBEDDED CODE OF 1 DATAPAGE </div> </td> </tr> <tr> <td> <div id="callback"> IFRAME CODE OF 2 DATAPAGE </div> </td> </tr> </table> <script type="text/javascript"> function autoRefresh_div() { $("#callback").empty().html('<iframe name="NAME OF SECOND DATAPAGE" title="NAME OF SECOND DATAPAGE" ' + 'style="width: 500px; height: 500px" ' + 'src="URL OF SECOND DATAPGE">Sorry, but your browser does not support frames.</iframe>'); // a function which will load data from other file after x seconds } setInterval(function() { autoRefresh_div(); }, 6000); </script> </body> </html> Please insert correct URLs and names of your DataPages.
  4. Aurora's post in Duplicating A Record In A Table From A Record In A Datapage Using Javascript. was marked as the answer   
    Hello JaredL.
    Welcome to Forum.
    I think this is an article that you are looking for.
    Let me know if you have some difficulties with a script. 
  5. Aurora's post in Redirect If Not Logged In was marked as the answer   
    Hello Chad!
    You could edit the Advanced Setting of your Authentication and set time limit for Timeout and TimeOut Redirection. 
    In this article you can see the procedure for LogOut button and use the same approach for TimeOut.
  6. Aurora's post in Is It Possible To Deny Submission, If A Checkbox Is Checked? was marked as the answer   
    Hello Cameron! 
    Hope you are doing well. 
    I have suggestion, which might help you . When a User selects No, he will receive a warning message and a Submit Button will be disabled. Then, if he selects Yes, a Submit Button will appear again. There is a script: 
    <SCRIPT LANGUAGE="JavaScript"> function MyFunction() { if (document.getElementById('InsertRecordYes_No').checked) { document.getElementById("Submit").style.display = "none"; alert(" You cannot submit a form. Please select NO "); return false; } else { document.getElementById("Submit").style.display = "inline"; } } document.getElementById('caspioform').onchange=MyFunction; </SCRIPT> I hope it is what you need. 
  7. Aurora's post in Update Checkbox When Virtual Radio Button Is Checked was marked as the answer   
    Hello eetimm!
    You were right, the issue was with virtual radio buttons.However, I have figured it out. I took IDs from your wed page, and I hope the following script works out  : 
    <script type="text/javascript"> function start(){ var form = document.getElementById('caspioform'); if(!form) return; var radios = form['cbParamVirtual7']; for(var i = 0; i < radios.length; i++) radios[i].onchange = myFunc } function myFunc(evt){ evt = evt || window.event; var node = evt.target || evt.srcElement document.getElementById('InsertRecordCBVer').checked = (node.value == '1'); } start(); </script> I hope this helps.
  8. Aurora's post in Automatic Field Update was marked as the answer   
    Hello Elena!
    You can try to activate your function when changes were made in the Calculation Field. For this try to change the last line of the script (.onsubmit->.onchange) , so it will we as follows:
    <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var x = document.getElementsByName("[@calcfield:44#]")[0].value; document.getElementById("InsertRecordNew_Job_Grade").value = x; } document.getElementById("caspioform").onchange=concatenate; </SCRIPT> i hope this helps.
    Have a nice day 
  9. Aurora's post in Passing Data From A Virtual Field To A Non-Virtual Field was marked as the answer   
    Hello ababcock !
    You can achieve this by using JavaScript . The sample is as follows :
    <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var x = document.getElementsByName("cbParamVirtual1")[0].value; document.getElementById("InsertRecordYour_Field").value = x; } document.getElementById("caspioform").onsubmit=concatenate; </SCRIPT> If you have 2 or more Virtual Fields you just need to change number in the following name of the parameter - "cbParamVirtual1" ( i.e cbParamVirtual2 , cbParamVirtual3) 
    I hope this helps you
    Have a good day 
  10. Aurora's post in Is It Possible To Calculate How Many Hours Were Spent? was marked as the answer   
    Hi Cameron !
    In my app I have a DataPage which shows how many hours Employee worked. I have created 2 LookUp tables named " Hours" (1-24) and " Minutes" (5,10,15,20,etc) , and one main table with following fields: 
    Here are steps which might help you:
    1) Create a new Submission Form.
    2) Select following fields from the main Table:
    Come_hour ( Dropdown Form Element) Come_minutes( Dropdown Form Element) Left_hour( Dropdown Form Element) Left_minutes( Dropdown Form Element)  
    These 4 fields take values from the "Hours" and "Minutes" Lookup Tables
    Worked_minutes ( Hidden Form Element)   
    This field  stores worked time
    3) Add the " Header&Footer" Element.
    4) Insert the following script  into the Footer : 
    <script> function f_collectTime(){ try{ var v_arH = Number(document.getElementById('InsertRecordCome_hour').value); var v_arM = Number(document.getElementById('InsertRecordCome_minute').value); var v_deH = Number(document.getElementById('InsertRecordLeft_hour').value); var v_deM = Number(document.getElementById('InsertRecordLeft_minute').value); document.getElementById('InsertRecordWorkedMinutes').value = (v_deH - v_arH) * 60 + (v_deM - v_arM); }catch(v_ex){} } try{ var v_btn = document.getElementById('Submit'); v_btn.onclick = f_collectTime; }catch(v_ex){} </script> 5) Go to the Destination&Emails step of the DataPage 
    6) Select " Display the message" form the Destination after record submit list.
    7) Insert the following script in the message field:
    Your work time is <Script> var v_timeSpan = Number('[@field:WorkedMinutes]'); var v_hours = Math.floor(v_timeSpan / 60); var v_minutes = v_timeSpan - v_hours * 60; document.write( String(v_hours) + ' hours ' + String(v_minutes) + ' minutes'); </script> I hope this can help you .
  11. Aurora's post in Multiple Checkbox Fields Value Check Against Dropdown Field Value was marked as the answer   
    Hello ccarls3, 


    Here is a script which might help you.


    For my app I used ten CheckBox Fields and one Dropdown Field with "Yes" and "No" values.


    On the Configure Fields step of your Submission Form add the Header&Footer element. Select the Header element , click on the "Source" button  and insert the following script there :



    <SCRIPT LANGUAGE="JavaScript">
    function concatenate()
      var x1 = document.getElementById("InsertRecordCheckBox1").checked;
      var x2 = document.getElementById("InsertRecordCheckBox2").checked;
      var x3 = document.getElementById("InsertRecordCheckBox3").checked;
      var x4 = document.getElementById("InsertRecordCheckBox4").checked;
      var x5 = document.getElementById("InsertRecordCheckBox5").checked;
      var x6 = document.getElementById("InsertRecordCheckBox6").checked;
      var x7 = document.getElementById("InsertRecordCheckBox7").checked;
      var x8 = document.getElementById("InsertRecordCheckBox8").checked;
      var x9 = document.getElementById("InsertRecordCheckBox9").checked;
      var x10 = document.getElementById("InsertRecordCheckBox10").checked;
      var x11 = document.getElementById("InsertRecordDropdown").value;
      if (x11=='No')
        if (x1 || x2 || x3 || x4 || x5 || x6 || x7 || x8|| x9 || x10)    
    /* "MESSAGE" is the text for displaying if you want to disable Submit Button . */
           return false;
    I hope it helps you !
  12. Aurora's post in Advanced Search Options was marked as the answer   
    Hello avaric, 
    I have resolved the similar issue by using Rules on my DataPage. I have a Table with 25 or more fields, and  use only 5 as main and other in case if " More Options" Checkbox is selected by User. I have a field "More options" in my table with Yes/No Datatype.
    Here are steps which might help you :
    1) In your Table create a field " Advanced Options" with Yes/No DataType.
    2) Create a new or edit your Report DataPage
    3) On the Configure Search Fields   step of the DataPage create a new Section, say Section 2 . Put there all fields you want to be displayed  if User select " Advanced Options" CheckBox.
    4) Make sure that "Advanced Options" field has Checkbox Form Element. 
    5) On the same page select Rule Tab and add a new rule : 
    Criteria Field :
    If "Advanced Option"  is not checked
    Action Field :
    Hide Section 2.
    Click " Save"
    Now all fields in Section 2 is hidden until User selects " Advanced Options" Checkbox.
    You can create more Sections and apply the same rule for each of them.
    You can find a screenshot of the Rule Tab in the attachments. 
    I hope this helps.

  • Create New...