Jump to content

Heineperson

Members
  • Content Count

    15
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Heineperson reacted to BaySunshine in Fixing concatenate function in JS code   
    Hi @Heineperson, 
    Caspio has stopped supporting onsubmit code:  https://howto.caspio.com/release-notes/caspio-bridge-13-0/13-0-impacted-areas/
    Please try the following fix:
    <SCRIPT LANGUAGE="JavaScript"> document.addEventListener('BeforeFormSubmit', function (event) { var x0 = document.getElementsByName("EditRecordassociatedSpecies")[0].value; var x1 = document.getElementsByName("cbParamVirtual2")[0].value; if (x0 && x1) {  document.getElementsByName("EditRecordassociatedSpecies")[0].value = x0+"; "+x1; } else {   document.getElementsByName("EditRecordassociatedSpecies")[0].value = x0 + x1; }  }); </SCRIPT>
  2. Like
    Heineperson reacted to perland in Print Button   
    If you just want to print the <form id="caspioform" ... a simple way will be to create a footer in your report form and copy the code below.
     
     
    <input type="button" onclick="printDiv('caspioform')" value="Print caspioform" />

     <script>
    function printDiv(divName) {
         var printContents = document.getElementById(divName).innerHTML;
         var originalContents = document.body.innerHTML;
         document.body.innerHTML = printContents;
         window.print();
         document.body.innerHTML = originalContents;
    }

    </script>

    VK.
  3. Like
    Heineperson reacted to Vitalikssssss in Replace document.write with innerHTML   
    Hi @Heineperson,
    Sorry, I forgot to add inner HTML in my code. Please try to use the following code:
    <div id='record[@cbRecordIndex#]'></div> <script type="text/javascript"> document.addEventListener('DataPageReady', function (event) { if ("[@field:tblRareTaxonTable_ProfileStatus]" == "Active") { document.getElementById("record[@cbRecordIndex#]").innerHTML="<div style='background:#A0CE4E;border:1px solid #000000;padding:5px 10px;'><span style='font-size:16px;'><strong><a href='https://saveplants.org/national-collection/plant-search/plant-profile/?CPCNum=[@field:tblRareTaxonTable_CPCNumber]' <span style='color:#482441;'>Go To Profile</span></a></strong></span></div>"; } else { document.getElementById("record[@cbRecordIndex#]").innerHTML="<div style='background:#482441;border:1px solid #000000;padding:5px 10px;'><span style='font-size:16px;'><span style='color:#FFFFFF;'><strong>Profile In Progress</strong></span></span></div>"; } }); </script> Regards,
    vitalikssssss
  4. Thanks
    Heineperson reacted to Vitalikssssss in Replace document.write with innerHTML   
    Hi @Heineperson,
    You can try following code with inner HTML:
    <div id='record[@cbRecordIndex#]'></div> <script type="text/javascript"> debugger; document.addEventListener('DataPageReady', function (event) { if ("[@field:tblRareTaxonTable_ProfileStatus]" == "Active") { document.write("<div style='background:#A0CE4E;border:1px solid #000000;padding:5px 10px;'><span style='font-size:16px;'><strong><a href='https://saveplants.org/national-collection/plant-search/plant-profile/?CPCNum=[@field:tblRareTaxonTable_CPCNumber]' <span style='color:#482441;'>Go To Profile</span></a></strong></span></div>"); } else { document.write("<div style='background:#482441;border:1px solid #000000;padding:5px 10px;'><span style='font-size:16px;'><span style='color:#FFFFFF;'><strong>Profile In Progress</strong></span></span></div>"); } }); </script> Hope this helps.
    Regards,
    vitalikssssss
×
×
  • Create New...