title: Can't disabled one of the two submit button and vice-versa
body: <p>I have a form which is in this pattern</p>
  
  <pre><code>&lt;form action="domains.php#searchdomain" method="post" name="m_domain"&gt;
        &lt;a name="searchdomain"&gt;&lt;/a&gt;
          &lt;table class="dataTable" width="100%" border="0" cellspacing="0" cellpadding="5" id="" style="text-align:center; margin-top:0px; border-left:1px solid #ddd; border-right:1px solid #ddd; border-top:1px solid #ddd;"&gt;
            &lt;tr&gt;
              &lt;td align="left" colspan="2"&gt;&lt;div id="display_message" &lt;?php echo $sstyle; ?&gt;&gt;&lt;?php echo $dis_msg; ?&gt;&lt;/div&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
              &lt;td align="left"&gt;Search Domain&lt;/td&gt;
              &lt;td align="left" style="display:none;" id="apply_text"&gt;Replace Selected Domains With&lt;/td&gt;
            &lt;/tr&gt;
  
            &lt;tr&gt;
              &lt;td align="center"&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;
                  &lt;tr&gt;
                    &lt;td&gt;&lt;input class="input_field" name="search_domain" id="search_domain" value="&lt;?php echo $search_domain; ?&gt;" type="text"&gt;&lt;/td&gt;
                    &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                    &lt;td&gt;&lt;input type="submit" class="btn blue_button" 
                      name="submit_domain_form" id="submit_search_button"
                    value="Search" onclick="return searchValidate();"&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                &lt;/table&gt;&lt;/td&gt;
              &lt;td align="center"&gt;&lt;table width="100%" border="0" cellspacing="0" cellpadding="0" id="apply_button" style="display:none;"&gt;
                  &lt;tr&gt;
                    &lt;td&gt;&lt;input class="input_field" name="domain_name_url" id="domain_name_url" value="&lt;?php echo $domain_name_url; ?&gt;" type="text"&gt;&lt;/td&gt;
                    &lt;td&gt;&amp;nbsp;
                    &lt;input name="domain_replace_id" id="domain_replace_id" 
                    value="" type="hidden"&gt;
                    &lt;input name="domain_replace_link" id="domain_replace_link" 
                    value="" type="hidden"&gt;
                    &lt;/td&gt;
                    &lt;td&gt;&lt;input type="submit" class="btn blue_button" 
                      name="submit_domain_form" id="submit_replace_button"
                    value="Apply" onclick="return validate();"&gt;&lt;/td&gt;
                  &lt;/tr&gt;
                &lt;/table&gt;&lt;/td&gt;
            &lt;/tr&gt;
            &lt;tr&gt;
              &lt;td align="center"&gt;
                  &lt;table width="100%" border="0" cellspacing="0" cellpadding="0"&gt;
                      &lt;tr&gt;
                        &lt;td&gt;&lt;input type="checkbox" name="status_domain" id="status_domain" &lt;?php if($status_domain){?&gt; checked &lt;?php } ?&gt;&gt;&amp;nbsp;Include inactive campaigns in search.&lt;/td&gt;
                        &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                        &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                      &lt;/tr&gt;
                  &lt;/table&gt;
              &lt;/td&gt;
              &lt;td align="center"&gt;&amp;nbsp;&lt;/td&gt;
            &lt;/tr&gt;
  
          &lt;/table&gt;
          &lt;?php
          echo '&lt;div style="border-bottom:1px solid #ddd; border-left:1px solid #ddd; border-right:1px solid #ddd;  width:100%; padding:10px;"&gt;';
          if(sizeof($request_list) &gt; 0)
          {
          echo ' 
          &lt;div class="pg_wrapper"&gt;
          &lt;div class="progress" style="width:80%;float: left;position: relative; top: 0; z-index: 999; display: none;"&gt;&lt;div class="progress-bar" role="progressbar" aria-valuenow="60"   aria-valuemin="0" aria-valuemax="100" &gt;&lt;/div&gt;&lt;/div&gt;&lt;div id="cancel_load" style="float: left; height: 23px; font-size: 12px; vertical-align:middle; padding-left: 5px; display: none;"&gt;&lt;a style="color:#428bca;" href="javascript:void(0);" &gt;&lt;strong&gt;Cancel&lt;/strong&gt;&lt;/a&gt;
          &lt;/div&gt;
          &lt;div class="clearfix"&gt;&lt;/div&gt;
          &lt;/div&gt;
          ';
          }
          echo '&lt;/div&gt;';
          ?&gt;
          &lt;div id="lp_pages_table" style="padding: 10px; border-left: 1px solid #ddd; border-right: 1px solid #ddd; border-bottom: 1px solid #ddd;"&gt;
              &lt;table class="display compact" width="100%" border="0" cellspacing="0" cellpadding="5" id="domains_list" style="margin-top:0px; border:1px solid #ddd;"&gt;
                  &lt;thead&gt;
                      &lt;tr&gt;
                      &lt;th style="text-align:center;"&gt;&lt;input type="checkbox" name="chk_all" class="checkall" id="checkedAll"&gt;&lt;/th&gt;
                      &lt;th&gt;URL&lt;/th&gt;
                      &lt;th&gt;Type&lt;/th&gt;
                      &lt;th&gt;ID&lt;/th&gt;
                      &lt;th&gt;Campaign&lt;/th&gt;
                      &lt;th&gt;Status&lt;/th&gt;
                      &lt;/tr&gt;
                  &lt;/thead&gt;
              &lt;/table&gt;
  
          &lt;/div&gt;
          &lt;/form&gt;
  </code></pre>
  
  <p>I want that,</p>
  
  <ol>
  <li>when <code>#search_domain</code> will have focus set on it, then the <code>#submit_replace_button</code> will be disabled.</li>
  <li>When the <code>#domain_name_url</code> will have focus on it, the <code>#submit_search_button</code> will be disabled</li>
  </ol>
  
  <p>For this, i have this code snippet</p>
  
  <pre><code>$(document).bind('keyup', function(e) 
  {
      if (e.keyCode === 13) 
      {
          //console.log("Replace focus :"+$('#domain_name_url').is(':focus')) 
          //console.log("Search focus :"+$('#search_domain').is(':focus'))
          if($('#domain_name_url').is(':focus')) 
          {
              console.log("Replace focus :"+$('#domain_name_url').is(':focus'))
              console.log("Search focus :"+$('#search_domain').is(':focus'))
              console.log("Inside Replace :")
              $('#submit_search_button').prop("disabled",true);
              $('#submit_replace_button').prop("disabled",false);
              $("#submit_replace_button").click();
          }
          else if($('#search_domain').is(':focus')) 
          {
              console.log("Replace focus :"+$('#domain_name_url').is(':focus'))
              console.log("Search focus :"+$('#search_domain').is(':focus'))
              console.log("Inside Search :")
              $('#submit_replace_button').prop("disabled",true);
              $('#submit_search_button').prop("disabled",false);
              $("#submit_search_button").click();
          }
          else
          {
  
          }
      }
  });
  </code></pre>