Jump to content

iren

Caspio Ninja
  • Posts

    78
  • Joined

  • Last visited

  • Days Won

    6

Community Answers

  1. iren's post in Modifying The Telephone Code (Javascript Help) was marked as the answer   
    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
  2. iren's post in Prevent Date Selection Less Than 2 Weeks In Future was marked as the answer   
    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.
  3. iren's post in Conditional Acknowledgement E-Mail was marked as the answer   
    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.
  4. iren's post in Calculate A % Of Records Where Columnvalue=X Using Sql was marked as the answer   
    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
  5. iren's post in Is It Possible To Display An Animation While The Data Is Submitted? was marked as the answer   
    Hi Cameron,
     
    You can paste the respective snippet inside the HTML Header and HTML Footer section.
     
    Header: 
    <h1 id="loadingTitle" style="display: none">Loading...</h1> Footer:
    <script> var v_appkey = 'appkey_number', v_appkeyInputs = document.getElementsByName('AppKey'), v_appKeyInput = null; for(var v_i = 0; v_i < v_appkeyInputs.length; v_i++){ if(v_appkeyInputs[v_i].value == v_appkey){ v_appKeyInput = v_appkeyInputs[v_i]; break; } } if(v_appKeyInput){ var v_formNode = null, v_tempNode = v_appKeyInput.parentNode; do{ v_formNode = v_tempNode; v_tempNode = v_tempNode.parentNode; }while(v_formNode && v_formNode.nodeName.toLowerCase() != 'form'); if(v_formNode){ v_formNode.onsubmit = function(){ var v_title = document.getElementById('loadingTitle'); if(v_title){ v_title.style.display = ''; } }; } }</script>  Hope it helps.
  6. iren's post in Is It Possible To Display Last 20 Records Of A Table? was marked as the answer   
    Hello Cameron,
     
    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 Header:
    <div align="center"> <p>Processing...</p> <img src="images/progress_bar.gif" alt="Progress Bar" width="200" height="15" /> </div> and 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);   setTimeout('document.forms["caspioform"].submit()',1000); }    </script> Hope it helps.
  7. iren's post in Concatenation Does Not Work In Update Forms was marked as the answer   
    Hello cogclou3,
     
    I would recommend to change document.getElementById('Submit').onmouseover to document.getElementById('Mod0EditRecord').onmouseover and
    document.getElementById('InsertRecordActual_DateTime') to document.getElementById('EditRecordActual_DateTime'). 
     
    Hope it helps.
  8. iren's post in Change The Color Of The Text Based On Criteria In If Statement was marked as the answer   
    Hi NJGonzo,
     
    Please move down the HTML block with the code. It should be placed after all DataPage elements.
  9. iren's post in Performance - Filter A View Vs. Datapage was marked as the answer   
    Hi Chad,
     
    As far as I know, there is no significant difference.
  10. iren's post in Calculated Field - Count, Datepart was marked as the answer   
    Hi Chad,
     
    You can use following code in aggregation field: 
    COUNT(CASE WHEN (DATEPART(hh, DateTime) >= 10 AND DATEPART(hh, DateTime) <= 16) THEN DateTime ELSE NULL END)
    DateTime should be changed on your value.
     
    Hope it helps.
×
×
  • Create New...