Jump to content


Caspio Rockstar
  • Posts

  • Joined

  • Last visited

  • Days Won


Everything posted by TellMeWhy

  1. TellMeWhy

    Auto Search

    What's your code? What's the issue of 1 again? use "input" instead of "change" for your event listener (it will trigger on the FIRST keypress tho)
  2. ah, maybe, use &&(AND) instead of II(OR)
  3. Can you try removing the quotations? I know it works, but we're using numbers here, so, it would be more fitting to use it as a number, remove quotation from both the calc field and the numbers
  4. Since 60 is constant, you can also make it 60.0 , add the .0 so the system will know it's supposed to be float
  5. It should be EditRecord then instead of InsertRecord
  6. HTML BLOCKS <button id="button1" type="button">Start</button> <button id="button2" type="button">END</button> FOOTER: <script> document.getElementById("button1").addEventListener("click", function tx(){ var date = new Date(); document.getElementById("InsertRecordFIELDNAME").value = date.toLocaleString("en-US").replace(',',''); document.getElementById("button1").removeEventListener("click", tx); //so button will only work once remove line if you want to keep it clickable }); </script> <script> document.getElementById("button2").addEventListener("click", function tx1(){ var date = new Date(); document.getElementById("InsertRecordFIELDNAME").value = date.toLocaleString("en-US").replace(',',''); document.getElementById("button2").removeEventListener("click", tx1); //so button will only work once remove line if you want to keep it clickable }); </script>
  7. Your code works as expected on mine, what are you trying to input? you said mininum of 1, and max of 5, you can only input 1,2,3,4,5 there nothing else. Is the min and maximum length instead of value?Other Media
  8. it's not in a table form, so there's really no alignment here. Dirty way : &nbsp; or use style individually dl > dt:nth-child(){ margin-right:15px !important; }
  9. Something like this? If yes, I added <br /> at the end of each Label On Header: <style> dd{ background-color:yellow; } </style> dd is for the data, dt is for labels Here's script for the conditional: from https://howto.caspio.com/tech-tips-and-articles/advanced-customizations/how-to-dynamically-change-the-background-of-a-results-page/ <div id="visi[@field:UNIQUEID]"> </div> <script> if([@field:FIELDINNUMBER] < 10){ var isi = document.getElementById("visi[@field:UNIQUEID]"); isi.style.display = 'none'; isi.parentNode.parentNode.children[5].style.backgroundColor = 'red'; } </script> change children number, as well. I suggest putting the HTML block at the end. use ctrl shift c then count the elements under the <dl> starting from 0. Mine is the 6th child, so, it's 5
  10. Anything Dynamic in a Webpage needs JavaScript Put this on your Label <span id="CurrMonth"></span> Then on Footer <script> var d = new Date(); var n = d.getMonth(); var months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; document.getElementById("CurrMonth").innerHTML = months[n]; </script> getMonth returns 0 for January, 1 for February and so on
  11. Well, it's pretty much a bunch of if else, For example, if I have these three fields that I want filled, I can check it like this <script> document.addEventListener("BeforeFormSubmit", function tx(Ev){ var field1=document.getElementById("InsertRecordTitle").value; var field2=document.getElementById("InsertRecordTEXT").value; var field3=document.getElementById("InsertRecordTry_add").value; var arr=[field1, field2, field3]; if(arr.includes("")){ Ev.preventDefault(); //from the function tx(Ev) above, prevents Form to Submit alert("Please fill all required fields."); } }); </script>
  12. @aaronfreed You're missing closing parentheses and brackets. Can you try the code again? Instead of converting the field to a Number, we'll just check if it's NaN (not a Number) then, it alerts and sets the value to 1. Note that the DEFAULTING to 1 is OUTSIDE the input event listener, what's inside are just the conditions for validation
  13. I believe Validation is a backend thing unless you want to validate each field using JavaScript yourself, would putting the loading screen AFTER submission not work, does the form have to be on the background? but, I guess it doesn't really make sense to put loading screen AFTER submission.
  14. Ah, Inline, I don't really like going there, but, I guess this is pretty simple. Here's the Inline Insert Example for ALERT and then change the value to 1 <script> document.addEventListener("DataPageReady", function fx(){ // Upon Load set value of FIELDNAME to 1 document.getElementById('InlineAddFIELDNAME').value ='1'; //change FIELDNAME to actual Field Name document.addEventListener("input", function tx(){//check of any inputs being done var field1=document.getElementById('InlineAddFIELDNAME'); //change FIELDNAME to actual Field Name if(field1.value < 1 || field1.value > 5){ alert("Field cannot be less than 1 or greater than 5"); field1.value ='1'; } if(isNaN(field1.value)== true){ //checks if the value is not a number alert("Field should be a number"); field1.value ='1'; } }); }); </script> Here's the Inline Edit version <script type="text/javascript"> document.addEventListener("click", function(event){ if(event.srcElement.getAttribute("data-cb-name") == 'InlineEdit'){ //checks if the clicked element is the Inline Edit Button document.addEventListener('input', function(e){ var field1 = document.querySelector('input[name="InlineEditFIELDNAME"]'); if(field1.value < 1 || field1.value > 5){ alert("Field cannot be less than 1 or greater than 5"); field1.value ='1'; } if(isNaN(field1.value)== true){ //checks if the value is not a number alert("Field should be a number"); field1.value ='1'; } }); } }); </script>
  15. It needs JavaScript to force users to not be able to submit if it doesn't meet the criteria. You can use Virtual Field > Calculated Value to check if those criteria are met. Use the method here:
  16. Strange, you only have 50 records. Maybe it's because it's clustered? Have you tried removing the images in the Results Page, as well?
  17. Yeah, decimal version is much better for me, too. Is that time manually typed? Like Minute: 11 Seconds 30 . Like that?
  18. I don't understand... What DataPage are you creating? another Tabular? Would using iframe deployment not work? If you're just using DataPages, iframe is the only possible way. Embedding both on a single webpage is much better, tho
  19. What exactly do you want to do? Do you want the minute and seconds combined upon Submission, or they're just in separate fields? What do you mean by converting seconds into minutes, why do you want to do this? Do you want to add this to the minute field, and have like one field for combined Minute and Seconds? You can probably do both of these using Calculated Values. Basically, you'll use Virtual Fields to get the input for minutes and seconds, then, you'll set the actual fields as Calculated Values. You can combine the Minutes and seconds there through simple math https://howto.caspio.com/datapages/datapage-components/calculated-values/
  20. It's the document.getElementById('EditRecordLead_Docent') that's non-existent, are you sure this is Update Form or Submission Form? If this is a Submission Form. use InsertRecord instead of EditRecord
  21. Seems that if you have a 'Report' in file name, it gets corrupted. 'Reports' work fine EDIT: nvm it seems that it's the short date
  22. huh, Customer Report ShortDate gets mine corrupted, as well.
  23. Oh, it's corrupt in mine, as well, but it's xml and not crdownload. Have you tried duplicating this DataPage and test it again? Mine works fine, you probably have to contact the support since it might be a configuration issue
  24. How exactly are you downloading the file again?
  25. Just change the function name on the second one also you can use value ^="Option 2" instead of the whole thing, ^= just means it STARTS with the value
  • Create New...