Jump to content

telepet

Caspio Ninja
  • Posts

    82
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by telepet

  1. Thanks @Meekeee. I was able to get it working via he below code. I'm also am working on incorporating an additional Upload C option, which is proving harder to get working. I think it has to do with a flaw in my logic somewhere. Or, I'm learning about Javascript's switch functionality, and wondering if that might work better here. <script> var UploadA='[@field:Credential_Upload_A]'; var UploadB='[@field:Credential_Upload_B]'; var UploadC='[@field:Credential_Upload_C]'; // A populated, B & C are blank if (UploadA.length>0 && UploadB.length==0 && UploadC.length==0) { document.getElementById("EditRecordCredential_Upload_A").style.visibility = 'hidden'; document.getElementById("EditRecordCredential_Upload_ARemove").style.visibility = 'hidden'; document.querySelector('label[for="EditRecordCredential_Upload_ARemove"]').style.visibility = 'hidden'; document.getElementById("upload_button_A").style.visibility = 'hidden'; } // A & B populated, C is blank else if (UploadA.length>0 && UploadB.length>0 && UploadC.length==0) { document.getElementById("EditRecordCredential_Upload_B").style.visibility = 'hidden'; document.getElementById("EditRecordCredential_Upload_BRemove").style.visibility = 'hidden'; document.querySelector('label[for="EditRecordCredential_Upload_BRemove"]').style.visibility = 'hidden'; document.getElementById("upload_button_B").style.visibility = 'hidden'; document.getElementById("EditRecordCredential_Upload_A").style.visibility = 'hidden'; document.getElementById("EditRecordCredential_Upload_ARemove").style.visibility = 'hidden'; document.querySelector('label[for="EditRecordCredential_Upload_ARemove"]').style.visibility = 'hidden'; document.getElementById("upload_button_A").style.visibility = 'hidden'; } // Note: Unable to get this to work so just removed Upload C option // // // // A, B, and C are populated // else (UploadA.length>0 && UploadB.length>0 && UploadC.length>0) // { // document.getElementById("EditRecordCredential_Upload_C").style.visibility = 'hidden'; // document.getElementById("EditRecordCredential_Upload_CRemove").style.visibility = 'hidden'; // document.querySelector('label[for="EditRecordCredential_Upload_CRemove"]').style.visibility = 'hidden'; // document.getElementById("upload_button_C").style.visibility = 'hidden'; // document.getElementById("EditRecordCredential_Upload_B").style.visibility = 'hidden'; // document.getElementById("EditRecordCredential_Upload_BRemove").style.visibility = 'hidden'; // document.querySelector('label[for="EditRecordCredential_Upload_BRemove"]').style.visibility = 'hidden'; // document.getElementById("upload_button_B").style.visibility = 'hidden'; // document.getElementById("EditRecordCredential_Upload_A").style.visibility = 'hidden'; // document.getElementById("EditRecordCredential_Upload_ARemove").style.visibility = 'hidden'; // document.querySelector('label[for="EditRecordCredential_Upload_ARemove"]').style.visibility = 'hidden'; // document.getElementById("upload_button_A").style.visibility = 'hidden'; // } </script>
  2. I've since added an additional and additional upload "B", as well as "Upload" buttons for each upload. I'd like to have these button hidden upon a respective file being uploaded. Button A is coded like this, with Button B having a different id (upload_button_B): <input class="uploadButton" id="upload_button_A" name="Mod0EditRecord" type="submit" value="Upload" /> I've added the following commented lines in my Javascript in order to hide these upload buttons. However, the buttons remain visible even after file/s are uploaded. Below is my code. Any ideas what I might be doing wrong? <script> var UploadA='[@field:Credential_Upload_A]'; var UploadB='[@field:Credential_Upload_B]'; if (UploadA.length>0) { document.getElementById("EditRecordCredential_Upload_A").style.visibility = 'hidden'; document.getElementById("EditRecordCredential_Upload_ARemove").style.visibility = 'hidden'; document.querySelector('label[for="EditRecordCredential_Upload_ARemove"]').style.visibility = 'hidden'; document.getElementById("upload_button_A").style.visiblity = 'hidden'; //Hide upload button A } if (UploadB.length>0) { document.getElementById("EditRecordCredential_Upload_B").style.visibility = 'hidden'; document.getElementById("EditRecordCredential_Upload_BRemove").style.visibility = 'hidden'; document.querySelector('label[for="EditRecordCredential_Upload_BRemove"]').style.visibility = 'hidden'; document.getElementById("upload_button_B").style.visiblity = 'hidden'; //Hide upload button B } </script>
  3. @Meekeee thanks for the example script, but I'm afraid it's sill not working. The "Choose File" and "Remove" checkbox is still showing even after uploading a test file. @KlisaN137 the DataPage is tabular type, with Responsive set to be on. I wonder if I'm needing to adjust Element ID due to how Caspio does inserted and edited data ([@field:FIELDNAME] , [@InsertRecordFIELDNAME] and [@EditRecordFIELDNAME], per this Caspio article: Why do I get blank values in emails?
  4. I'm able to hide "Choose File" button by inserting the following code into the footer. However, it seems to show again once I click the "Update" button. Any ideas? <script> var UploadA='[@field:Credential_Upload_A]'; if (UploadA.length>0) { document.getElementById("EditRecordCredential_Upload_A").style.visibility = 'hidden'; document.getElementById("EditRecordCredential_Upload_ARemove").style.visibility = 'hidden'; } </script>
  5. Users are uploading files. Is there a way to append a prefix or suffix to the name of their uploaded file? For example, if someone uploads a file called myFile, I'd like to add date file was uploaded to the name of the file, as well well as name of user who uploaded file, along with text. So, myFile becomes myFile_uploaded_2021_11_10_by_userFirstName_userLastName.
  6. Is there a way to download in Logs (Beta)?
  7. Thanks @sandy159. I have a hunch a script I have in the header/footer may be the culprit. I will investigate further. In the interim, I've set up rules on the Details page so that Update and Back buttons only appear until users verifies all fields. It's a bandaid fix for this odd behavior. I'll update this thread if I figure out a better solution.
  8. I have a Tabular Report Datapage for which I have enabled editing on its Details page. I would like user to be able to edit a field, click the Update button, and stay on the Details page to continue editing other field if they wish. Currently when Update button is clicked, user is taken back to the Results page of the Tabular Report. I've tried setting Destination after record update to be "Same Form", "Display Message", and "Go to Results Page" but nothing keeps user on the Details page for the same record that's being edited. Any ideas?
  9. Any updates on this? CTRL-F5 and clearing cache may work sometimes but is confusing for our users that are not as computer savvy, and I don't believe that's platform agnostic guidance either. So, any alternative solutions would wonderful to hear. Thanks!
  10. Thanks @Franchiser. I'm wondering-- can you explain why it necessary to uncheck the "Enable HTLM editor" checkbox? I've experimented with having it checked and things still seems to work ok.
  11. Thanks @MayMusic for the information. I've since created a Details datapage that summarize the user input and has two buttons-- one that allows them to go back to the Sincle Record Update page, and another button (labled "Confirm Submission") that actually logs out the user. Depending how this solution works in real life, I may end up using your much simpler solution. Thanks again.
  12. Thanks @Carlson. I'm using a Single Record Update data page, but will explore building out a Details data page, like the one you mentioned above. That said, I wonder on the feasibility of hiding the default "Update" button, then creating another button that is labeled "Submit", but have it be the logout link on the backend. II've hidden a search button before using this code in the header: <style> #searchID { display:none; } </style> ..and so far I seem to be able to hide the Submit button by replacing #searchID with #Mod0EditRecord. Now I think I need to find out how to make a button that both submits and logs out the user... I'll update this thread once I've explored a bit.... Thanks again!
  13. I'm working on a Single Record Update data page. Is it possible to have automatic logout upon hitting the update button?
  14. I'm creating a form with several cascading elements. There will only be one result after the cascading happens. I'd like to retrieve this result but I'd prefer to hide it from the user who is completing the form. Is this possible? Edit: I'm guessing it would be best to simply make a view and then pull any parameters as needed, but it also seems like there might be a way to retrieve results by passing parameters. For the moment I've constructed a view that achieves what I need, but would be grateful if anyone has any suggestions on this front.
  15. Thanks @Vitalikssssss. That link is full of very useful information. I think the JS solution does the trick. Thanks too to @Franchiser. I was able to solve this via CSS as well, using this code provided elsewhere in the forum (link): <style> #searchID { display:none; } </style>
  16. This works perfectly. Thanks @Mathilda.
  17. The above code works wonderfully, and enables a little more flexibility when it comes to layout. I wonder, is it possible to do hide the default "Search" button? I'm attempting to incorporate a search page where there is a "Reset Search" button next to a "Search" button.
  18. Thanks @Franchiser. I'll explore the CSS code a bit. Unfortunately the site is behind a login screen, so I'm unable to share that out.
  19. I've been exploring the possibility of adding a script in the header and/or footer that "hides" the Search button but not having much luck yet. It seems like the cbSearchButton class has a dynamically generated suffix preventing a hard coded script from consistently hiding it. Here's an example of what I've tried so far: <script> document.getElementById("[cbSearchButton]")[0].style.visibility = "hidden"; </script>
×
×
  • Create New...