title: How can I write a code in apex that fires an alert when client selects a specific choices from 2 items
body: <p>I have two items, <code>P4_oper_type</code> and <code>P4_plan</code> they are both drop down lists
  all I want to do is when the client chooses <em>"Partial Surrender"</em> from <code>P4_oper_type</code> and <em>"A"</em> from  <code>P4_plan</code>
  an alert appears on the page, any other choice that client makes other than the specified conditions nothing happens.</p>
  
  <p>I tried to write this code :</p>
  
  <pre><code>function cond(){
  var item1 = apex.item("P4_oper_type").getValue();
  var item2= apex.item("P4_plan").getValue();
  
   if (item1.value == "Partial Surrender") &amp;&amp; (item2.value == "A") {
    window.alert('omar')
   };
   else null;
    };
  </code></pre>
  
  <p>There is the place where I wrote my code, I don't know if this is the right place or there is something wrong with this code:</p>
  
  <p><img src="https://i.stack.imgur.com/FjTxU.png" alt="code sample"></p>
  
  <p>These are the two items to be selected by client with the condition :
  <img src="https://i.stack.imgur.com/MSZtJ.png" alt="two items to be selected by client with the conditions"></p>