Jump to content

iren

Caspio Ninja
  • Posts

    78
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by iren

  1. Hello costar,

     

    You can use following code in the footer field: 

    <SCRIPT type="text/javascript">
    
    function f_a(v_id){ return document.getElementById(v_id); }
    function f_b(v_id){ return f_a('InsertRecordcheckbox' + v_id);}
    function f_findParentTR(v_node){
     var v_parentNode = v_node;
     if(!v_node) return null;
     while(v_parentNode && String(v_parentNode.nodeName).toUpperCase() != 'TR')
      v_parentNode = v_parentNode.parentNode;
    
     return v_parentNode;
    }
    function CheckboxesCheck() {
     if (f_b("1").checked){
      f_b("2").checked=true;
      f_b("3").checked=true;
     } else {
        if(!f_b("2").checked){
        f_findParentTR(f_b("2")).style.display='none';
        }
        if(!f_b("3").checked){
        f_findParentTR(f_b("3")).style.display='none';
        }
     }
    }
    f_b("1").onchange=CheckboxesCheck;
    </script>

    Note: The code works for three fields with 'Yes/No' DataTypes. 

     

    Hope it helps.

     

    IREN

  2. Hello srauhe,

     

    Go through the following steps:

    1) Create a users tables and that table will have two yes no fields User & Manager along all the other fields.
    2) Create two DataPages one for Admin and another for user
    3) You will see a script for redirecting people depending on their authentication. 
    4) In the User report you will filter the records by authentication so the user will be able to see what he is supposed to see. 
    5) The other datapage for the manager will not have any filter.
     
    Hope it helps  :)
     
    IREN 
  3. Hi peterhanse,

     

    You can create the lookup table with the field with 'Autonumber' DataType.
    On the 'Configure Search Fields' select 'Dropdown' form element, 'Greater Than' comparison type, the 'lookup table' source, sort by Z->A for the fieldwith 'Autonumber' DataType.
     
    Than to add the next code in the HTML block:
    <script type="text/javascript">
    
    function my_funct()
    {
      document.getElementById("Value1_1").options[20].selected = true;
    }
    
    
    if(document.getElementById("caspioform")) {
    
    
      document.getElementById("caspioform").style.display = 'none';
      setTimeout('my_funct()',500);}
      
    </script>

    Hope it helps.

     

    IREN

  4. Hello larsonchst,

     

    You can add this code to the Footer (do not forget clicking the Source button and changing FIELDNAME to the name of your field):

    <SCRIPT LANGUAGE="JavaScript">
    function f_a(v_id)
    {
    return document.getElementById(v_id);
    }
    f_a('InsertRecordFIELDNAME').maxLength = 14;
    f_a('InsertRecordFIELDNAME').onkeyup = function(v_e)
    {
    v_e = v_e || window.event;
    if (v_e.keyCode >= 65 && v_e.keyCode <= 90){
    this.value = this.value.substr(0, this.value.length - 1);
    return false;
    }else if (v_e.keyCode >= 37 && v_e.keyCode <= 40){
    return true;
    }
    var v_value =(this.value.replace(/[^\d]/g, ''));
    if (v_value.length==12){
    this.value = (v_value.substring(0,6) + "-" + v_value.substring(6,12));}
    }
    </SCRIPT>

    Hope it helps.

     

    IREN

  5. Hello esisov,

     

    You can add this code to the Footer (do not forget clicking the Source button and changing FIELDNAME to the name of your field):

    <SCRIPT LANGUAGE="JavaScript">function f_a(v_id)
    {
    return document.getElementById(v_id);
    }
    f_a('InsertRecordFIELDNAME').maxLength = 10;
    f_a('InsertRecordFIELDNAME').onkeyup = function(v_e)
    {
    v_e = v_e || window.event;
    if (v_e.keyCode >= 65 && v_e.keyCode <= 90){
    this.value = this.value.substr(0, this.value.length - 1);
    return false;
    }else if (v_e.keyCode >= 37 && v_e.keyCode <= 40){
    return true;
    }
    var v_value =(this.value.replace(/[^\d]/g, ''));
    if (v_value.length==8) {
    this.value = (v_value.substring(0,2) + "/" + v_value.substring(2,4) + "/" + v_value.substring(4,8));}
    }
    </SCRIPT>

    Hope it helps.

     

    IREN

  6. Hello alanhoffman,

     

    I would recommend you to create the 'Orders' table:

     

    Customer     Order            Qty

    Customer1   HotDog           1

    Customer1   Fries               2

    Customer1   Shake             1

    Customer1   Coke               1

    Customer2   Fries               2

    Customer2   Burger            2

    Customer3   OnionRings    1

    Customer3   HotDog           1

    Customer3   Coke               1

    Customer4   Burger            2

     

    Than you can create Tabular DataPage, group by 'Order' field and add the aggregation field that summarize the values of 'Qty' field and select to calculate aggregation for the first group.

     

    Hope it helps.

     

    IREN

  7. Hello kenanjones,

     

    Please change it:

    <script src="[@app:URL_5]"></script>
    <script src="[@app:URL_3]"></script>
    <link href="[@app:URL_1]" rel="stylesheet" >
    <link href="[@app:URL_4]" rel="stylesheet">
    <link href="[@app:URL_2]" rel="stylesheet">

    into:

    <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/styles/github.min.css"></script>
    <script src="https://gitcdn.github.io/bootstrap-toggle/2.2.0/js/bootstrap-toggle.min.js"></script>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.3/styles/github.min.css" rel="stylesheet" >
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet">
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">

    in your script.

     

    Hope it helps.

  8. Hello Aurora,

     

    You can paste the following code

    in Header: 

    <script src="[@app:URL_5]"></script>
    <script src="[@app:URL_3]"></script>
    <link href="[@app:URL_1]" rel="stylesheet" >
    <link href="[@app:URL_4]" rel="stylesheet">
    <link href="[@app:URL_2]" rel="stylesheet">
    <style>
    .checkbox label .toggle,
    .checkbox-inline .toggle {
     ;
     margin-right: 5px;
    }
    
    .toggle {
     position: relative;
     overflow: hidden;
    }
    .toggle input[type="checkbox"] {
     display: none;
    }
    .toggle-group {
     position: absolute;
     width: 200%;
     top: 0;
     bottom: 0;
     left: 0;
     transition: left 0.35s;
     -webkit-transition: left 0.35s;
     -moz-user-select: none;
     -webkit-user-select: none;
    }
    .toggle.off .toggle-group {
     left: -100%;
    }
    .toggle-on {
     position: absolute;
     top: 0;
     bottom: 0;
     left: 0;
     right: 50%;
     margin: 0;
     border: 0;
     border-radius: 0;
    }
    .toggle-off {
     position: absolute;
     top: 0;
     bottom: 0;
     left: 50%;
     right: 0;
     margin: 0;
     border: 0;
     border-radius: 0;
    }
    .toggle-handle {
     position: relative;
     margin: 0 auto;
     padding-top: 0px;
     padding-bottom: 0px;
     height: 100%;
     width: 0px;
     border-width: 0 1px;
    }
    
    .toggle.btn { min-width: 59px; min-height: 34px; }
    .toggle-on.btn { padding-right: 24px; }
    .toggle-off.btn { padding-left: 24px; }
    
    .toggle.btn-lg { min-width: 79px; min-height: 45px; }
    .toggle-on.btn-lg { padding-right: 31px; }
    .toggle-off.btn-lg { padding-left: 31px; }
    .toggle-handle.btn-lg { width: 40px; }
    
    .toggle.btn-sm { min-width: 50px; min-height: 30px;}
    .toggle-on.btn-sm { padding-right: 20px; }
    .toggle-off.btn-sm { padding-left: 20px; }
    
    .toggle.btn-xs { min-width: 35px; min-height: 22px;}
    .toggle-on.btn-xs { padding-right: 12px; }
    .toggle-off.btn-xs { padding-left: 12px; }
    
    header, footer {
     padding: 20px;
     background-image: url('header.png');
     background-size: 256px 256px;
    }
    footer {
     color: #fff;
     text-align: center;
    }
    .nyt-logo {
     max-height: 40px;
     margin-top: 5px;
     margin-right: 5px;
    }
    
    nav.navbar {
     margin-bottom: 10px;
     background-color: #fff;
     border: 0px;
     border-radius: 2px;
    }
    #navbar {
     margin: 0px;
    }
    #navbar .navbar-nav li iframe {
     margin-top: 15px;
    }
    #navbar .navbar-nav li:last-child iframe {
     margin-right: 15px;
    }
    
    @media screen and (max-width: 767px) {
     #navbar .navbar-nav li iframe {
      display: none;
     }
    }
    
    .mast-head {
     margin: 10px 0;
    }
    .mast-head h1 {
     margin-bottom: 15px;
     color: #fff;
    }
    .mast-head p {
     color: #fff;
    }
    
    .mast-links {
     padding-top: 10px;
    }
    
    .mast-links > * {
     vertical-align: middle;
     margin-bottom: 10px;
    }
    
    .mast-links > .btn {
     margin-right: 30px;
    }
    main {
     margin: 10px 20px;
    }
    main .container {
     margin-bottom: 40px;
    }
    
    code.hljs {
     border: 1px solid #ccc;
     padding: 1em;
     white-space: pre;
     margin-bottom: 10px;
    }
    
    .example {
     position: relative;
     border: 1px solid #ccc;
     padding: 1em 1em 0.5em 1em;
     border-radius: 4px 4px 0 0;
    }
    
    .example:after {
     content: "Example";
     position: absolute;
     top: 0px;
     right: 0px;
     padding: 3px 7px;
     font-size: 12px;
     font-weight: bold;
     background-color: #f5f5f5;
     border: 1px solid #ccc;
     color: #9da0a4;
     border-radius: 0px 4px 0px 4px;
     border-width: 0px 0px 1px 1px;
    }
    
    .example + code.hljs {
     border-top: 0;
     border-radius: 0px 0px 4px 4px;
    }
    
    .example > * {
     margin-bottom: 10px;
    }
    
    .example > div.toggle {
     margin-right: 10px;
    }
    
    .table-striped code {
     background-color: inherit;
    }
    </style>

    and in Footer:

    <script>
      $(function() {
        $('#InsertRecordyour_field').bootstrapToggle();
      })
    </script>

    Enter name of your field instead of your_field. 

     

    Hope it helps.

  9. Hello alanhoffman, 

     

    You can paste following code into the Footer of the Calendar result page:

    <script>
    window.onload = function(){
    try
    {
    var v_nodes = document.querySelectorAll('span[class*="cbResultSetData"]');
    for(var v_i= 0 ; v_i < v_nodes .length; v_i++){
    if(v_nodes.item(v_i).innerHTML.search('AV')!= -1){
    v_nodes.item(v_i).style.color = '#00FFFF';
    }
    if(v_nodes.item(v_i).innerHTML.search('NA')!= -1){
    v_nodes.item(v_i).parentNode.parentNode.parentNode.style.background = '#A00101';
    }
    }
    }
    catch(v_ex){}
    };
    </script>

    Hope it helps.

  10. Hello abitaquest,

     

    On your Submission Form, you can add a Header & Footer element. Then you can select the Footer element, click the "Source" button and enter the following code:

    <SCRIPT LANGUAGE="JavaScript">
    
    
    function check_date()
    {
    var entered_value = document.getElementById("InsertRecordDate").value;
    var entered_date = new Date(entered_value);
    
    
    var two_week_date = new Date();
    two_week_date.setDate(two_week_date.getDate() + 14);
    
    
    if(entered_date < two_week_date)
       {
          alert("Please select a date after 2 weeks");
          return false;
       }
    }
    
    
    document.getElementById("caspioform").onsubmit=check_date;
    </SCRIPT>

    Please enter name of your field instead of "FIELDNAME" in the line

    var entered_value = document.getElementById("InsertRecordFIELDNAME").value;
     
    Also you can enter your message instead of "Please select a date after 2 weeks".
     
    I hope, it helps.
  11. Hello Scott,

     

    If you use Submission DataPage, you can add virtual field on the 'Configure Fields' step, make it hidden, add the 'Header&Footer' field and paste the following code in the footer: 

    <script type= "text/javascript">
    function checkbox()
    {
    if(document.getElementById("InsertRecordSmart_Meter_Authorization").checked)
    {
    document.getElementById("cbParamVirtual1").value =  document.getElementById("InsertRecordSmart_Meters").value;
    }
    else document.getElementById("cbParamVirtual1").value = "";
    }
    document.getElementById("caspioform").onsubmit = checkbox;
    </script>
    Than go to the 'Email Options' step and insert virtual field using parameter picker in the HTML message body.
     
    Hope it helps.
  12. Hello codell,

     

    You can add the following code in the 'Formula' section in the calculated field:

    (CONVERT(float, (SELECT COUNT(Project) FROM TableName WHERE Project=target.[@field:Project] AND Status=target.[@field:Status])))/(CONVERT(float, (SELECT COUNT(Project) FROM TableName WHERE Project=target.[@field:Project])))*100

    Enter name of your table instead of TableName.

     

    Hope it helps

×
×
  • Create New...