Jump to content


Caspio Rockstar
  • Posts

  • Joined

  • Last visited

  • Days Won


Reputation Activity

  1. Thanks
    Mathilda got a reaction from Chikitaisaac123 in Radio buttons to select timeframe for graphed data   
    Hi TMeyer,
    You may add a criteria to the date field on a search page to filter records for selected period. User needs to enter two dates - "from" date and "to" date and he'll get records for the selected period. The first criteria should be "Grater than or equal", the second one - "Less than or equal", also you need to select "AND" logical operator between criteria.
    Another option - you may create several reports with different predefined criteria (month, past year...) and deploy them in separate webpages or even direct URL in links. However in my opinion it's not the best solution, because  you have to create separate report for each case.
    So I would recommend to use the first option with date range.
    Hope it helps
  2. Like
    Mathilda got a reaction from hctrr in Redirect user if not logged in   
    You need to specify the designated entry page. Edit the authentication and expend the advanced settings. Then edit Timeout and redirection. In the  Designated entry page: select go to a new page and paste an URL where you have deployed the login screen.
    Hope it helps
  3. Like
    Mathilda got a reaction from KenColcreate in Store only date, month and year instead of timestamp   
    Hi Mylene,
    Try using the following script:
    <SCRIPT LANGUAGE="JavaScript">  Stamp = new Date();  var v_TimeStamp;  v_TimeStamp=('' + (Stamp.getMonth() + 1) +"/"+Stamp.getDate()+ "/"+Stamp.getFullYear()); document.getElementById("InsertRecordDate_field").value=v_TimeStamp; </SCRIPT> Please add your field name instead of Date_field. 
    Hope it helps.
  4. Thanks
    Mathilda got a reaction from Mylene in Increment value in one field based on status in another field   
    Hi, you may use the following script in the footer of the datapage:
    <SCRIPT LANGUAGE="JavaScript">   function calculate() { var check = document.getElementById("InsertRecordField_name").value; if(check =="Approved"){ var v_increment = parseFloat(document.getElementsByName("cbParamVirtual1")[0].value);    document.getElementById("InsertRecordField2").value = v_increment+1;  } }  document.getElementById("caspioform").onsubmit=calculate; </SCRIPT> You need to use a virtual field to sort values in descending order and get the last submitted value, then increment value and write in a field
  5. Like
    Mathilda got a reaction from MayMusic in Current day of the week in an App Parameter   
    In this case you may use java script. I created a simple example for you, you should paste script in the footer of the datapage:
    <script> window.onload = function myFunction() {     var d = new Date();     var weekday = new Array(7);     weekday[0] = "Sunday";     weekday[1] = "Monday";     weekday[2] = "Tuesday";     weekday[3] = "Wednesday";     weekday[4] = "Thursday";     weekday[5] = "Friday";     weekday[6] = "Saturday";     var n = weekday[d.getDay()];     document.getElementById("InsertRecordField_name").value = n; } </script> Enter name of your field instead of: Field_name
  6. Like
    Mathilda got a reaction from bookish in PLugin error with Caspio deploy   
    Try  adding <?php session_start(); ?> at the beginning of the "class-datapage-loader.php" file. Also, please remove any trailing spaces at the beginning of that file. You may find more details here
  7. Like
    Mathilda reacted to douvega in Overwrite Localization Date Format on datapage   
    Why dont changing the format in a way both regions can understand? Instead of 01/08/2017 make it 08/Jan/2017?
    Hope it helps.
  8. Like
    Mathilda got a reaction from telepet in Multiple Search Buttons   
    You may hide a standard button using the following code in  the header of the search page:
    <style> #searchID { display:none; } </style>  
  9. Like
    Mathilda got a reaction from SongLian in Send multiply emails to addresses selected in list datatype field   
    Hi SongLian, I changed code for the footer, it should work now:
    <script> $('[name=cbParamVirtual2').change(function() { $('[name=cbParamVirtual3').val($('[name=cbParamVirtual2').val()) }); </script> <script> function replace(){ var res=  document.getElementsByName('cbParamVirtual3')[0].value; var newchar = '; ' res = res.split(',').join(newchar); document.getElementsByName('cbParamVirtual3')[0].value=res;   } document.getElementById("caspioform").onsubmit=replace; </script>  
  10. Like
    Mathilda got a reaction from Mylene in generate coordinates on update   
    I modified script from this article. 
    Code for the header:
    <div id="cbwrapper"> Code for the footer:
    </div><script type='text/javascript'> var lat_id = 'EditRecordlat'; var lng_id = 'EditRecordlng'; var address_id = 'EditRecordAddress'; var city_id = 'EditRecordCity'; var state_id = 'EditRecordState'; var zip_id = 'EditRecordZip'; var wrapper_id = 'cbwrapper'; var msg1 = 'Please input a valid address'; if(typeof jQuery != 'undefined'){ var cb_geocoder = cb_geocoder = new google.maps.Geocoder(); $('#'+wrapper_id+' input[id=Mod0EditRecord]').click(function(e){ e.preventDefault(); var add = $('#'+address_id).val(); var city = $('#'+city_id).val(); var state = $('#'+state_id).val(); var zip = $('#'+zip_id).val(); if(!add || !city || !state || !zip){ alert(msg1); }else{ var full = add +','+city+','+state+' '+zip; cb_geocoder.geocode({address: full}, cbCallBack); } }); }else{ document.write('This Datapage require Standard Caspio Deployment for full functionality.'); } function cbCallBack(locResult){ if(locResult != "" && locResult.length>0){ var lat1 = locResult[0].geometry.location.lat(); var lng1 = locResult[0].geometry.location.lng(); lat1 = Number(lat1); lng1 = Number(lng1); $('#'+lat_id).val(lat1); $('#'+lng_id).val(lng1); $('#'+wrapper_id+' form').submit(); }else{ alert(msg1); } } </script> Code for the html file where the datapage is deployed:
    <script type="text/javascript" src="https://lib.caspio.com/pub/jquery/jquery.js"></script> <script src="//maps.googleapis.com/maps/api/js?v=3.exp&sensor=false&key=YOUR_KEY" async="" defer="defer" type="text/javascript"></script> You should place those two lines above the deploy code of the datapage.
    Paste your google apikey instead of: YOUR_KEY
  11. Thanks
    Mathilda got a reaction from Clint in Multiple Search Buttons   
    try placing the following code in an html block above all the fields:
    <input type="submit" name="searchID" id="searchID1" value="Search" class="cbSearchButton">  
  12. Like
    Mathilda got a reaction from Mylene in resize an iframe   
    I have a solution for your case. You may find code below:
    <script>https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script>   function resizeIframe(obj) {     obj.style.height = obj.contentWindow.document.body.scrollHeight + 'px';   } </script> <iframe src="URL_of the datapage" frameBorder="0" scrolling="no" width=100% onload="resizeIframe(this)">Sorry, but your browser does not support frames.</iframe>  
    Don't forget to insert your URL instead of: URL_of the datapage
  13. Like
    Mathilda got a reaction from Melwyn in Combining Report and Form datapages same webpage - single Auth.   
    Regarding hiding multiply login forms, you may have a look at this article
    Since you use grouping, "inline insert" cannot be enabled for your report. However, if grouping is not very important for you, you may try disabling groping and enabling  inline insert. IMHO this is best option for this case, because you can insert data directly on report
  14. Thanks
    Mathilda got a reaction from jmcriley in disable "UPDATE" button on Report Details page   
    The update button appears only if you have at least one editable field on the datapage. Perhaps you hide that field using rules or javascript.
    Anyway you can hide update button using java script. Just add header/footer and paste the following code in the footer:
    <script> window.onload = function hide(){ document.getElementById("Mod0EditRecord").style.visibility = 'hidden'; } </script>
  15. Thanks
    Mathilda got a reaction from danielg05 in Data Page - Submission Form   
    This kind of validation can be done using Java Script. Have a look at this post
  16. Thanks
    Mathilda got a reaction from Sindhuja in How to create repeatable section in the submission form?   
    How do you wish to store this information? I suppose it should be different records. If yes, you may specify "same form" in the destination page. This will let you open a clean form again after previous information is entered.
    If you wish to keep all the information in one records, you may have a look at this solution 
  17. Thanks
    Mathilda got a reaction from rickin21 in Calculation on values entered in Submission Form Help   
    InsertRecord is missing before field names in the following lines:
    You may use onblur event in order to run function onchange, also I would recommend adding one more conditions in order to check that all the values which are being used in calculation are fulfilled with data
    <SCRIPT LANGUAGE="JavaScript">  function calculate()  {    var v_hours = parseFloat(document.getElementById("InsertRecordRegular_Hours").value);    var v_hoursot = parseFloat(document.getElementById("InsertRecordOT_Hours").value);     var v_rates  = parseFloat(document.getElementById("InsertRecordRates").value); var v_ratesot  = parseFloat(document.getElementById("InsertRecordRate_OT").value); if (isNaN(v_hours) || v_hours.length<1) {  v_hours = 0; }else if (isNaN(v_hoursot) || v_hoursot.length<1) { v_hoursot = 0; }else if (isNaN(v_rates) || v_rates.length<1) { v_rates = 0; }else if (isNaN(v_ratesot ) || v_ratesot.length<1) { v_ratesot = 0; } var v_amount  = ((v_hours * v_rates)+(v_hoursot * v_ratesot)); if ( isNaN(v_amount)){ v_amount = ""; } document.getElementById("InsertRecordAmount").value = v_amount;  }  document.getElementById("InsertRecordRegular_Hours").onblur=calculate;  document.getElementById("InsertRecordOT_Hours").onblur=calculate; </SCRIPT> Cheers!
  18. Like
    Mathilda got a reaction from MicrosoftEdge in How to remove Table Borders on website   
    Try placing css into the header of the datapage:
    <style> #caspioform tr { border: none !important; } #caspioform td { border: none !important; } </style> You may also place additional elements if needed.
    Hope that helps!
  19. Thanks
    Mathilda got a reaction from DaeBo in Show a link when 30 days has passed   
    Try using double quotes for the URL of the datapage:
  20. Thanks
    Mathilda got a reaction from RussellParker in Require at least one Search Field to have data entered   
    Hi Russ, welcome to forum!
    Try inserting the following code in the footer of your search form:
    <SCRIPT LANGUAGE="JavaScript">  function check()  { var first= document.getElementById("Value1_1").value; var second = document.getElementById("Value2_1").value;     if (( first.length  === 0) &  ( second.length  === 0)) { window.alert("Please enter a value in a field"); return false; } }  document.getElementById("searchID").onclick=check; </SCRIPT>  
  21. Like
    Mathilda got a reaction from tconnery in Use a Formula within a Formula   
    Yes, there is a workaround. You can perform this calculation in a calculated field on a report datapage
  22. Like
    Mathilda got a reaction from Kennylj24 in Text to list   
    As far as I know, it's not possible to convert any datatype to string. It's a new datatype and hope conversion capability will be added soon.
  23. Like
    Mathilda got a reaction from lmooring in If..Then Statement in Submission Form   
    I also added a condition to check that fields are not blank. You need to use your field names instead of mine.
    <SCRIPT LANGUAGE="JavaScript">  function check()  { var COMPLEXUNITS= parseFloat(document.getElementById("InsertRecordCOMPLEXUNITS").value); var SIMPLEUNIT = parseFloat(document.getElementById("InsertRecordSIMPLEUNIT").value); var PACKTYPE = document.getElementsByName("InsertRecordPacktype")[0].value;     if( PACKTYPE =='Simple' ) { if (SIMPLEUNIT !=1 || typeof SIMPLEUNIT  == 'undefined' || !SIMPLEUNIT || SIMPLEUNIT.length  === 0 || SIMPLEUNIT  === "" || !/[^\s]/.test(SIMPLEUNIT) || /^\s*$/.test(SIMPLEUNIT) || SIMPLEUNIT.replace(/\s/g,"") === "" ) { window.alert("Value in the SIMPLEUNIT field should be equal 1"); return false; } } else if (PACKTYPE =='Complex'){ if ( COMPLEXUNITS <2 || typeof COMPLEXUNITS == 'undefined' || !COMPLEXUNITS  || COMPLEXUNITS.length  === 0 || COMPLEXUNITS  === "" || !/[^\s]/.test(COMPLEXUNITS ) || /^\s*$/.test(COMPLEXUNITS ) || COMPLEXUNITS .replace(/\s/g,"") === "") {  window.alert("Value in the COMPLEXUNITS field should be grater or equal  2"); return false; } } }  document.getElementById("caspioform").onsubmit=check; </SCRIPT>  
  24. Like
    Mathilda got a reaction from rwoolf in Taking first letter from field A and combining with field B to create Field C   
    it can be done using sql substing query in the formula field: SUBSTRING ([@field:First_name] ,1 , 1)  + SUBSTRING ([@field:Last_name] ,1, 1)
    However, in case of further using username field in authentication, this is not the best option since you can using only unique field as a username.
    Therefore, you may insert the following script in the footer of your submission form.
    <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var position1 = document.getElementById("InsertRecordFirst_name").value; var position2 = document.getElementById("InsertRecordLast_name").value; document.getElementById("InsertRecordUsername").value = position1.substring(0, 1) + position2.substring(0, 1); } document.getElementById("caspioform").onsubmit=concatenate; </SCRIPT>  
  25. Like
    Mathilda got a reaction from ianjtaylor in Style sheet from my webpage removes all styling from my reports and forms   
    Hi blarney,
    This is the common problem for CMS users. If you use embed code, the datapage become a part of a webpage, hence inherits all style attributes, defined for the webpage. Is your CMS allows editing CSS code of your theme? If yes, you need to edit CSS of your CMS and delete or edit some attributes.
    If you can't edit CSS of the theme, overwrite elements in the header of the datapage. For example, if your CMS enforces borders, add the following code in the header of datapage:
    <style> #caspioform tr { border: none !important; } #caspioform td { border: none !important; } </style>  
    Using iframe deployment eliminates style issues, however you may face problems with passing parameters.
    Hope that helps
  • Create New...