title: ORACLE APEX : Alert Display when Checkbox not Checked
body: <p>I am currently having an interactive report in ORACLE APEX, where i use the report to display many records as rows and columns from the database. One such column is the check box.All the check boxes in the report are rendered like this : <code>APEX_ITEM.CHECKBOX2(1,GROUP1.CAM_QER_LINE_GROUP_ID,'UNCHECKED',p_item_id=&gt;'p01_1')</code> </p>
  
  <p>There are buttons in the report such as '<strong>Save</strong>' which save the changes made to the records in the report. </p>
  
  <p>On <strong>clicking the Save button</strong>, all the changes made to the checked records should be going through successfully, <strong>else an alert/message or similar kind</strong> should pop-up and <strong>ask the user to check the box</strong> and save the changes. </p>
  
  <p>I know there are multiple ways to do this. The ways that i have tried so far but wasn't completely successful are mentioned below.  </p>
  
  <pre><code>if apex_application.g_f01.count = 0
       then   
          apex_error.add_error (
          p_message          =&gt; 'Invalid Customer ID!',
          p_display_location =&gt;  apex_error.c_inline_with_field_and_notif,
          p_page_item_name   =&gt; 'P5_CUSTOMER_ID');
       else 
          --- DO THE REST
  </code></pre>
  
  <p>In this above method, I am using this code in the <strong>PL/SQL process</strong> which runs at the <strong>point of processing</strong> after <strong>clicking of the Save Button</strong> but the problem that I am facing is once the error_message is displayed, it gets re-displayed <strong>on click of even other buttons</strong> which do a <strong>submit</strong> of the page/other processing, which defeats the purpose. </p>
  
  <pre><code>    if (document.getElementById('p01_1').checked) 
          { alert("checked"); } 
     else
          { alert("Please Check the Box."); }
  </code></pre>
  
  <p>In this above method, the problem is that <em>getElementById('p01_1')</em> is not able to <strong>identify each checkbox in the report</strong> and is throwing the alert 'Please Check the Box' even if <strong>some out of all</strong> check boxes are checked. </p>
  
  <p>Looking for a simple solution to this problem that I am facing. </p>