Jump to content

telepet

Caspio Ninja
  • Posts

    87
  • Joined

  • Last visited

  • Days Won

    3

Reputation Activity

  1. Like
    telepet reacted to TellMeWhy in Java Script to Hide the Update Button   
    Keep in mind hiding these buttons through CSS will not disable them. If anyone presses 'Enter' they will be able to 'click' the button.
    You need JavaScript to disable it completely and then use CSS for hiding, or you can use JavaScript for both. For Submission, you do it like:
    <script> document.getElementsByClassName('cbSubmitButton')[0].disabled = true; document.getElementsByClassName('cbSubmitButton')[0].style.display = 'none'; </script>
    Update Form/Details Page
    <script> document.getElementsByClassName('cbUpdateButton')[0].disabled = true; document.getElementsByClassName('cbUpdateButton')[0].style.display = 'none'; </script>
    If you have multiple forms on a single Webpage, just change 0 to any number depending on the order of the forms, 0 means it's the first form, and so on.
     
    If you just really want to hide, then just remove the 1st line.
  2. Like
    telepet reacted to Kurumi in Hide Button and Label Based On Checked Box   
    Hi @telepet - can you try this one:
    <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 } else 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> If you have another if, you will need to add else to the if. For reference, you may check it here: https://www.w3schools.com/js/js_if_else.asp
    To check any errors of your JavaScript code, you can right click your webpage then select Inspect -> go to Console and let us know if you have any errors.
    Hope it helps!
  3. Thanks
    telepet reacted to cheonsa in Check if File Field is Blank   
    Hi @IamBlossom, 
    For File DataTypes, you need to use SQL's "DATALENGTH" to measure if the field has content or not. It is a behavior that NOT NULL or IS NULL will not work for File Datatype.
    Use this instead:
    CASE WHEN DATALENGTH([@field:Images]) = 0 THEN 'No image attached' ELSE 'Image available' END
     
    Hope this helps!
  4. Like
    telepet got a reaction from Kurumi in Hide Button and Label Based On Checked Box   
    Thanks @KlisaN137! That works.
  5. Like
    telepet reacted to KlisaN137 in Hide Button and Label Based On Checked Box   
    Hi  @telepet
    If it is a Tabular Report, I'm guessing you want this on Details Page?
    Yes, you need to adjust Element ID, in this case, where you see 'EditRecord' and 'Remove', just follow the same logic. Also, add another part to get rid of the label 'remove':
    <script> var UploadA='[@field:FIELDNAME]'; if (UploadA.length>0) { document.getElementById("EditRecordFIELDNAME").style.visibility = 'hidden'; document.getElementById("EditRecordFIELDNAMERemove").style.visibility = 'hidden'; document.querySelector('label[for="EditRecordFIELDNAMERemove"]').style.visibility = 'hidden'; } </script> Please instead of using the code in the Footer of the page, add another HTML block element just after the last element, and put the code in it, this will execute code again when the file is uploaded after using Update button.
  6. Like
    telepet got a reaction from Kurumi in Possible to add a prefix or suffix to uploaded files?   
    Thanks @Meekeee.  
  7. Like
    telepet reacted to Tubby in Caspio User logs   
    Unfortunately there is no way to download the logs in the new UI. But you can still access the old user logs by typing this to the URL: https://<accountID>.caspio.com/ui/userlogs

    Just change <accountID> to your account ID which you can find in account settings.
  8. Like
    telepet reacted to Mathilda 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
    telepet reacted to MayMusic in Convert Text Number To Phone Format.   
    @telepet
     
    Change this line
    document.getElementById(o_els[i]).onchange=tel;  
    To:
    document.getElementById(o_els[i]).onkeyup=tel;  
  10. Like
    telepet reacted to MayMusic in Grid edit by default   
    You can try to change the style to:
    <style> .cbGridCtnr > .BodyCtnr > .Table{ width: auto; } .cbGridCtnr > .HeadCtnr > .Table { width: auto; } </style>  
     
  11. Like
    telepet got a reaction from TMeyer in Formula Field that conditional populates if...   
    I was getting hung up on using the proper case for my True/False column.  I had been using 'TRUE' instead of 'True'.  Got it working with this:
    CASE WHEN [@field:my_number_field] >= 2.00 AND [@field:my_yes_no_field] = 'True' THEN 'Grade is ≥ 2.00' ELSE '' END New to SQL.  SQL plus formula data type will be pretty powerful.
  12. Like
    telepet reacted to casGary in Is There Still A 'range' Option In Comparison Type Dropdown?   
    Hi Gregory, 
    when setting up a Comperison type as "Begins with", you are still able to define the Range start and the Range end. So this might be just a temporary issue with the name of this option in comparison type.
    See the screenshot.
    http://screencast.com/t/mppex3aFD
  13. Like
    telepet got a reaction from AnotherUser in Add button to HTML Password Reset   
    I'd like to incorporate styling in the email that is generated via a Password Reset data page.  Specifically, I'd like to turn the password reset link into a button.  Here are some examples of what I'm attempting to achieve: link.  
  14. Like
    telepet reacted to MayMusic in Auto-populate a blank column in a newly imported table with an App parameter   
    This is not possible in Caspio platform, unless you write a trigger to add the value once there is a new entry to the table. It is easier if you do it in Excel and them import the complete sheet to Caspio
  15. Like
    telepet reacted to aam82 in Emailing all contacts in a table   
    There are some buggy ways to prepopulate the user's email program with a list of emails. One bug that I don't like is the opening of a new tab as a side-effect. Another is call to location.href with a mailto: link getting served over http, causing a mixed contect warning. There is also the window prompt you linked to, which has a 2,000 character limit.
    Since you have fewer than 999 addresses in the data set you want to use, you won't run into the 999 record per page Caspio limit, so I suggest the following, adapted from the second response to the same SO thread you linked:
    In your datapage footer, add the following code
    <p id="emailCount"></p> <textarea id="emailOutput" style="width: 500px; height: 200px;"></textarea> <p> <button class="js-textareacopybtn">Copy Emails to clipboard</button> </p> <SCRIPT LANGUAGE="JavaScript"> var elems = document.getElementsByTagName("td"); var copiedEmails = []; var numEmails = 0; for (var i=0, m=elems.length; i<m; i++) { if (elems[i].innerText.includes("@")) { copiedEmails.push(elems[i].innerText); numEmails += 1; } } var joinedEmails = copiedEmails.join("; "); document.getElementById("emailOutput").innerHTML= joinedEmails; document.getElementById("emailCount").innerHTML= "Found " + numEmails + " emails."; </script> <script> var copyTextareaBtn = document.querySelector('.js-textareacopybtn'); copyTextareaBtn.addEventListener('click', function(event) { var copyTextarea = document.getElementById("emailOutput"); copyTextarea.select(); try { var successful = document.execCommand('copy'); var msg = successful ? 'successful' : 'unsuccessful'; console.log('Copying text command was ' + msg); } catch (err) { console.log('Oops, unable to copy'); } }); </script>  
    Which searches for strings containing an "@" character, adds each to an array, then joins the array with "; " for better pasting into an email client. It also displays a count of addresses found:

     
  16. Like
    telepet reacted to MayMusic in Does View update itself if source Table design is changed?   
    Each time you open a view or call a view via DataPage, view is making a call to table to filter the data. Therefore the data is being generated on each call so data is updated. But as for the design as it is mentioned above newly added fields should be available in the wizard but they need to be included (by default they are not included in view).
    You also have the option to change the name of the fields in the view to make them shorter. By default you have TableName_FieldName if you change table name part and leave "_" by moving to next field system will ask you if you want to have the same naming for other fields as well to change them all at once
  17. Like
    telepet reacted to JEllington in Does View update itself if source Table design is changed?   
    I have found that if you add a new field to a table, and you have a view associated with the table the field added to the table shows in the view without the “Include field in View” box checked.
    If you go into the view and navigate to “Field Properties”, you will find your newly added field at the bottom of the list, select it, then check the “Include field in View” check box under field options.
  18. Like
    telepet reacted to iren in How To Import Bulk Records That Use Unique Or System Generated Fields   
    Hello Berean,
     
    I would recommend you to create new table when you import data with unique fields. You can find the screenshot in the attachment.
     
    Please refer to this article for further information: http://howto.caspio.com/files-and-images/bulk-file-import-and-export/
     
    Hope it helps.

  19. Like
    telepet reacted to swipebox in Accessing Usps Address Verification For Address Validation And/or Modification   
    We need to do this:
     
    1. Collect data for first page with embedded Caspio datapage form.
    2. When user moves to next page (or, in some cases, the next field on the form), we need authenticate, using the USPS Address Information, the data entered on the page or field just exited (while user is entering the next piece/set of data).
    --Check with external web service to authenticate the info (eg, make sure the entered address is a USPS deliverable address and put the address in proper USPS format)
    --Edit the Caspio record with the cleaned up data.
    Or--if the data doesn't validate (eg, a non-deliverable mail address)--create a "flag" so that when the entry pages are finished, we can go back to this page and get better data.
    3. Etc. for each new "page" of data.
     
    So the question is: Is there a way to build a "trigger" into the Caspio DB that will access the USPS web service and run the authentication and data update automatically? Is this something we would use Caspio Web Service for? If not, what's the best way to do this (architecturally)? 
  20. Like
    telepet reacted to MayMusic in Reset button on Search Form does not work as needed   
    Button code would be
    <input type="button" onclick="window.location='[URL_for_my_search_page]'" value="Reset Search"/>  
  21. Like
    telepet reacted to DLReich in Reset button on Search Form does not work as needed   
    Thanks for the reference to the Localization settings.  That did the job of renaming the Search Again button. 
    I used @MayMusic's code with "URL" replaced by the url of the web page where I access my Caspio database.  On the Configure Results page (and Configure Details page), I first clicked insert (at the bottom of the list of elements) and then clicked Header and Footer.  Then I used insert again to create an HTML Block in the header.  I placed the code in the HTML Block in the header of both the results page and the details page.  To insert the code in the HTML Block, be sure to click Source before pasting the code.
  22. Like
    telepet reacted to MayMusic in Reset button on Search Form does not work as needed   
    Here is the code to create custom search again
    <a class="cbResultSetSearchAgainLink" href="URL"><img alt="Search again" src="https://c0cmr140.caspio.com/images/dp/SA_magnifier.png" style="vertical-align: text-bottom; border: 0px;" title="Search again" /> Search again</a>  
  23. Like
    telepet reacted to DLReich in Reset button on Search Form does not work as needed   
    Thanks very much.  The code works fine.  I labelled the button "New Search".  Is there any way to remove the "Search again" button or to relabel it "Modify Search"?
     
  24. Like
    telepet reacted to MayMusic in using a dropdown with the Inline edit in Search Report?   
    In inline edit you have option to choose form element as well, click on Editing tab and change it.
  25. Like
    telepet reacted to JEllington in Checkbox unchecked by default in Search Form   
    Within the element that has the Checkbox, select the Advanced tab, then in the "On load, checked by default" statement uncheck the box.
×
×
  • Create New...