visitNew.html 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <h1 id="formTitle">Title</h1>
  2. <table cellspacing="2" cellpadding="5" border="0" id="staticTable">
  3. <tr><td>CRF ID: </td><td><strong id="crfRefId">1583163135258</strong></td></tr>
  4. </table>
  5. <form name="visitForm" id="visitForm">
  6. </form>
  7. <div id="submitDiv"/>
  8. <div id="errorDiv" style="display:none">
  9. <textarea id="errorTxt" cols="95" rows="10"></textarea>
  10. </div>
  11. <div id="debugDiv" style="display:block"/>
  12. <script type="text/javascript">
  13. window.onload = loadScripts;
  14. function loadScripts(){
  15. let action=init;
  16. LABKEY.requiresScript(["crf/crfVisitNew.js"],action);
  17. }
  18. function init(){
  19. let searchParams = new URLSearchParams(window.location.search);
  20. //update this to pick crfRef from url
  21. let crfRef=searchParams.get('entryId');
  22. //let formSetupQuery=searchParams.get('formSetupQuery');
  23. document.getElementById("crfRefId").innerHTML=crfRef;
  24. crfVisit.crfRef=crfRef;
  25. crfVisit.masterForm="visitForm";
  26. crfVisit.formId=searchParams.get("formId");
  27. crfVisit.role=searchParams.get('role');
  28. crfVisit.clear();
  29. crfVisit.generateMasterForm();
  30. }
  31. </script>