Jump to content

aam82

Caspio Guru
  • Posts

    190
  • Joined

  • Last visited

  • Days Won

    10

Community Answers

  1. aam82's post in Reference display value of related field with Javascript was marked as the answer   
    link: http://stackoverflow.com/questions/5913/getting-the-text-from-a-drop-down-box
    instead of setting your variable to a value, try to set it to the text of the selected <option> property for that field.
  2. aam82's post in Emailing all contacts in a table was marked as the answer   
    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:

     
  3. aam82's post in Signature not displayed on Details page was marked as the answer   
    I can't see your datapage.
    Here is the code I use, on a Submission Form, with the exception of additionally loading jQuery. My signature field is hidden, in one HTML block I have the signature code, and in the other I have this to display the saved signature (if present):
    Saved Signature: <div class="sigPad"> <canvas class="pad" width="275" height="55"></canvas> </div> <script type="text/javascript"> var sig = [@field:Signature!]; var api = $('.sigPad').signaturePad({displayOnly:true}); api.regenerate(sig); </script>  
  4. aam82's post in Disable Checkbox Javascript Or Css was marked as the answer   
    I think I got it. This works in a footer element  HTML block (so that it runs after AJAX updates, instead of just once) when the column with data matching Yes is the first column following the checkbox.
     
    <SCRIPT LANGUAGE="JavaScript"> var elems = document.getElementsByTagName("td"); for (var i=0, m=elems.length; i<m; i++) { if (elems.innerHTML=="Yes")  { elems.previousSibling.style.display="none";} } </SCRIPT>   edit: if you have other data that might =Yes, then you might have to modify this. In my case, Yes can only appear in the one place that I'm targetting.
  5. aam82's post in Filtering Unique Values ​​? was marked as the answer   
    yes, filter a cascading dropdown of your colors table, by the field that "peter" occupies, and use the default "distinct options" checkbox.
  6. aam82's post in Make Calendar Popup Larger? was marked as the answer   
    div#CalendarToolBox {
      width: 240px!important;
    }
     
    #CalendarToolBox .BodyTable td div {
      font-size: 18px;
    }
×
×
  • Create New...