Caspio Ninja
  • Content count

  • Joined

  • Last visited

  • Days Won


Vitalikssssss last won the day on August 16

Vitalikssssss had the most liked content!

About Vitalikssssss

  • Rank
    Advanced Member
  1. Restrict the file type of the file upload

    Hi NeolnJS, You can find a solution here. Hope this helps.
  2. 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.
  3. Conditional statement in formula

    Hi JEllington, You should use "WHEN" i.o. "IF" in a Case statement. Hope this helps.
  4. 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.
  5. Hi Gilad, You should remove this part from Responsive Code: #datapage-form td { display: block; } Regards, vitalikssssss
  6. 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.
  7. Hello joscetre, I would suggest replacing triggered event to the following one: document.getElementById("Mod0EditRecord").onclick=CheckSubmit; Hope this helps.
  8. Can NOT submit by enter key

    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.
  9. Javascript Help Needed

    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.
  10. Can NOT submit by enter key

    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.
  11. Hi NicoleS, You should utilize one of Cascading form elements in order to achieve the requreid design. Hope this helps.
  12. Sum Payment Due based on search criteria

    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.
  13. Tying user logged in to form submissions

    Hello roattw, Perhaps you can utilize Caspio Bridge feature named Record-Level-Security. Hope this helps.
  14. 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: 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]; 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>
  15. Validating a Field

    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