Jump to content

SamPo

Members
  • Posts

    2
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

SamPo's Achievements

  1. Hello, I have the below code in the footer of a submission datapage, however in some circumstances it is bringing up multiple alert windows with the same message, one after the other. I've probably made a simple error somewhere in the coding, could anyone help? <script> document.addEventListener('BeforeFormSubmit', function(event) { if (event.detail.appKey == 'xxxxxxxxxxxxxxxxxxx') { let checkValue1 = document.querySelector("input[id*='InsertRecordno_of_selections_qty1']").value; if (checkValue1 > '1') { event.preventDefault(); alert("There too many lines selected for Qty 1"); return false; } } if (event.detail.appKey == 'xxxxxxxxxxxxxxxxxxx') { let checkValue2 = document.querySelector("input[id*='InsertRecordno_of_selections_qty2']").value; if (checkValue2 > '1') { event.preventDefault(); alert("There too many lines selected for Qty 2"); return false; } } if (event.detail.appKey == 'xxxxxxxxxxxxxxxxxxx') { let checkValue3 = document.querySelector("input[id*='InsertRecordno_of_selections_qty3']").value; if (checkValue3 > '1') { event.preventDefault(); alert("There too many lines selected for Qty 3"); return false; } } if (event.detail.appKey == 'xxxxxxxxxxxxxxxxxxx') { let checkValue4 = document.querySelector("input[id*='InsertRecordno_of_selections_qty4']").value; if (checkValue4 > '1') { event.preventDefault(); alert("There too many lines selected for Qty 4"); return false; } } if (event.detail.appKey == 'xxxxxxxxxxxxxxxxxxx') { let checkValue5 = document.querySelector("input[id*='InsertRecordno_of_selections_qty5']").value; if (checkValue5 > '1') { event.preventDefault(); alert("There too many lines selected for Qty 5"); return false; } } }); </script>
×
×
  • Create New...