Jump to content

Vitalikssssss

Caspio Rockstar
  • Content Count

    496
  • Joined

  • Last visited

  • Days Won

    49

Everything posted by Vitalikssssss

  1. Hi Newgoblin49, You can create a relational database in Caspio. You may find more details here: http://howto.caspio.com/tables-and-views/relationships/ Hope this helps.
  2. Hello mdav20, I would suggest creating the separate function, so you could call this function with a different event "onload". Hope this helps.
  3. Hi Rmorr, I have created following Javascript which will replace unnecessary elements from Timestamp value and concatenate modified value with a predefined prefix "WO-". You should have a Virtual field which will receive Timestamp parameter on page load. <script> function Replace(){ var a = document.getElementById("cbParamVirtual1").value; document.getElementById("InsertRecord_____Yourfield").value='WO-'+a.replace(/\/|:|\s+/g, ''); } document.getElementById("caspioform").onsubmit=Replace; </script> Please paste this script into Footer of your Submission Form. Hope this helps.
  4. Hi NikkiC, This topic should help to resolve your issue. Regards, Vitalikssssss
  5. Hello Rmorr, I would suggest using Short date format for timestamp which has reference name [@cbTimestamp*]. You can utilize Javascript function named replace in order to remove forward slashes from timestamp parameter. Hope this helps.
  6. Hi Rmorr, Thank you for your feedback. I`ve applied few changes to my initial solution which should resolve the issue. <script type="text/javascript"> var aaa= document.getElementById("BulkUpdateFormBody"); var v_li = aaa.getElementsByTagName("input"); var v_ls = aaa.getElementsByTagName("select"); var v_lt = aaa.getElementsByTagName("textarea"); var f_tmpf = function(v_list, v_resList){ var v_res = v_resList || []; var v_length = v_list.length; for(var v_i = 0; v_i < v_length; v_i++) if((v_list[v_i].type || "").search(/HIDDEN|button|image/ig)==-1 && (v_list[v_i].nodeName||'').search(/input|select|textarea/ig) != -1) v_res.push(v_list[v_i]); return v_res; } var v_cleanI=f_tmpf(v_lt, f_tmpf(v_ls, f_tmpf(v_li, []))); v_cleanI.forEach(function(v_i){ v_i.type == "checkbox" ? v_i.checked = false : v_i.value = ""; }); </script> Hope this helps.
  7. Hi there, I would like to share a JS solution which I have used for my project. This script that can be used to clear fields in the bulk edit screen. The bulk edit screen typically displays the data from the last update, and my JS allows not show the previous content of fields. Place following JS into the Footer of Bulk edit screen. Make sure that you have disabled HTML editor. <script type="text/javascript"> var aaa= document.getElementById("BulkUpdateFormBody"); var v_li = aaa.getElementsByTagName("input"); var v_ls = aaa.getElementsByTagName("select"); var v_lt = aaa.getElementsByTagName("textarea"); var f_tmpf = function(v_list, v_resList){ var v_res = v_resList || []; var v_length = v_list.length; for(var v_i = 0; v_i < v_length; v_i++) if((v_list[v_i].type || "").toUpperCase()!="HIDDEN" && (v_list[v_i].nodeName||'').search(/input|select|textarea/ig) != -1) v_res.push(v_list[v_i]); v_resList = v_res; return v_res; } var v_cleanI=f_tmpf(v_lt, f_tmpf(v_ls, f_tmpf(v_li, []))); v_cleanI.forEach(function(v_i){ v_i.value = ""; }); </script> I hope this will be useful for someone.
  8. Hi NeolnJS, You should be aware that not all email clients support Iframe. I have found following information about email clients which support Iframe. Hope this helps.
  9. Hi NeolnJS, You can find a solution here. Hope this helps.
  10. Hi rickin21, You may try to change the triggering event to ".onsubmit". <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); var v_amount = ((v_hours * v_rates)+(v_hoursot * v_ratesot)); document.getElementById("InsertRecordAmount").value = v_amount; } /* On submitting the webform, the function calculate is executed */ document.getElementById("caspioform").onsubmit=calculate; </SCRIPT> Hope this helps.
  11. Hi JEllington, You should use "WHEN" i.o. "IF" in a Case statement. Hope this helps.
  12. Hi LuluSW, I would suggest adding "Any" option to your drop-down. You can allow a user to add an option to the drop-down by using concept described in this article. Hope this helps.
  13. Hi Gilad, You should remove this part from Responsive Code: #datapage-form td { display: block; } Regards, vitalikssssss
  14. Hi Alexm72, You should put Javascript code into the Footer element of Datapage. Please make sure that you disable HTML editor before inserting the code. I have created following JS for your particular case. Please note that this JS designed for Submission Form Datapage. <script language="JavaScript"> function check_string () { var disabled = false; if (document.getElementById("InsertRecordMyTestField").value) == “BadName”) disabled = true; if (disabled) { alert("Bad Name are not allowed"); return false; } } document.getElementById("caspioform").onsubmit=check_string; </script> Hope this helps.
  15. Hello joscetre, I would suggest replacing triggered event to the following one: document.getElementById("Mod0EditRecord").onclick=CheckSubmit; Hope this helps.
  16. Hi Lukas, This part of the logic expression of your code has assign operator "=" i.o. equality check operator "==", hence this block will not execute even if valuesize variable equal 10. else if (valuesize = 10) { cbParamVirtual3.value = idvalue; return true; } You may try to use this code: <SCRIPT LANGUAGE="JavaScript"> function checkSubmit(){ var idvalue = document.getElementById("cbParamVirtual4").value; var valuesize = idvalue.length; if (valuesize == 6) { document.getElementById("cbParamVirtual2").value = idvalue; return true; } else if (valuesize == 10) { document.getElementById("cbParamVirtual3").value = idvalue; return true; } return false; } document.forms[0].onsubmit=checkSubmit; </SCRIPT> Hope this helps.
  17. Hi Jeff, I can share with you a solution which I have been using for a similar case. You will need to create to Datapages. 1. Submission form - this Datapage will consist of Virtual fields; 2. Report Form - this Datapage will be filtered based on received from Submission form; Here some settings for each Datapage: Submission form Virtual field should pass parameter on exit; Footer of Datapage should have following JS: <script> function Replace(){ var a = document.getElementById("cbParamVirtual1").value; document.getElementById("cbParamVirtual1").value=a.replace(/\s+/g, '||cb||'); } document.getElementById("caspioform").onsubmit=Replace; </script> Destination after record submit option should be set to "Go to Datapage". You should specify Report page in Datapage name section; Report Form Search form should be enabled; Form element Listbox should be selected for the filtering field; Comparison type "Equal" should be selected; In the Advanced tab of filtering field, you should configure: Allow multi-select - checked; Match any (OR) radio button selected; Receive value or parameter - checked; Value: "External Parameter" - please specify the name of parameter from Submission form; Use auto-submit JS in the Footer of Search Form; Note: You should use "space" to separate searchable values; Hope this helps.
  18. Hi Lukas, I believe that you have encountered an issue because you are referencing the Virtual field with incorrect syntax, hence your function returning "False". You may try to use following Javascript: <SCRIPT LANGUAGE="JavaScript"> function checkSubmit(){ var idvalue = document.getElementById(“cbParamVirtual4”).value; var valuesize = idvalue.length; if (valuesize == 6) { document.getElementById(“cbParamVirtual4”).value = idvalue; return true; } else if (valuesize == 10) { document.getElementById(“cbParamVirtual4”).value = idvalue; return true; } return false; } document.forms[0].onsubmit=checkSubmit; </SCRIPT> Hope this helps.
  19. Hi NicoleS, You should utilize one of Cascading form elements in order to achieve the requreid design. Hope this helps.
  20. Hello Breee, You can use simple Total&Aggregation field to sum paymentdue values if your Datapage source table is the same as the one which you are referencing in your SQL expression. Hope this helps.
  21. Hello roattw, Perhaps you can utilize Caspio Bridge feature named Record-Level-Security. Hope this helps.
  22. Hi Everyone, I would like to share a solution on how to generate geolocation coordinates on Update/Details datapages. My solution based on following HowTo article: http://howto.caspio.com/tech-tips-and-articles/advanced-customizations/tech-tip-generating-geolocation-coordinates-from-web-form-submissions/ Please use this JS instead of the one from step #3 of above article: </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>
  23. Please provide the details of your workflow. Perhaps, you can use GUID datatype to generate the promotion code automatically in lookup table. GUID A system-generated and globally-unique identifier value, typically used as a complex unique value. Data-types
  24. Hello Student2017, I am sure that desired workflow can be achieved on the Details page. You should add a Virtual field which will use Form element "Checkbox" and input email address in Field Option section named "Value then checked:". You will be able to use this Virtual field in notification email recipient field"To:". Hope this helps.
  25. Hello gbecker, I would suggest creating a separate table with promotion codes and use this table as a Lookup table in your Submission form. You should add a Virtual field to your Submission Form and use Cascading form element in order to retrieve a value from the Lookup table. You may use HTML blocks to hide the Virtual field from your users as described in this article. You can use my JS code example below as a reference: <SCRIPT LANGUAGE="JavaScript"> function myFunction(){ var v = document.getElementsByName("cbParamVirtual2")[0].value; if(v) { return true; } else { alert("Wrong code"); return false; } } document.getElementById("caspioform").onsubmit=myFunction; </SCRIPT>
×
×
  • Create New...