Textbox Changes are not Reflecting in JavaScript
<p>I have the following JavaScript function. I have two textboxes, two hiddenfields and two labels. and a button. On the click of a button I am calling this function.</p>

<p>On typing value in the textbox, It shows an autoCompleteList. On picking a value from this, it fetches the value from DB and fills the corresponding label. Also, at the same time it stores the corresponding selected value in hiddenfield.</p>

<p>Whenever one changes the value in textbox and without selecting the value from autoPopulated list, It must show the alert.</p>

<p>The function is working fine, If I fill a single textbox, but when I fill both, It goes to the Point A, instead of showing the alert of Point B</p>

<pre><code>function ConfirmBox()
 {
    var txtBoxValue = document.getElementById("&lt;%= txtFromPartNumber.ClientID %&gt;").value;
    var txtBoxValue1 = document.getElementById("&lt;%= txtToPartNumber.ClientID %&gt;").value;
    var release = document.getElementById("&lt;%= lblFromPartNumber.ClientID %&gt;").innerText;
    var release1 = document.getElementById("&lt;%= lblToPartNumber.ClientID %&gt;").innerText;
    var hdnFromValueID = "&lt;%= hdnFromReleaseNumber.ClientID %&gt;";
    var hdnToValueID = "&lt;%= hdnToReleaseNumber.ClientID %&gt;";
     if ((txtBoxValue &amp;&amp; txtBoxValue.trim() != "" &amp;&amp; release))
     {
         if (document.getElementById(hdnFromValueID).value.trim() == txtBoxValue.trim()) 
         {
             if ((txtBoxValue1 &amp;&amp; txtBoxValue1.trim() != "" &amp;&amp; release1))  
             {
                 if (document.getElementById(hdnToValueID).value.trim() == txtBoxValue1.trim()) 
                 {
                    return true; //Point A
                 }
                 else
                 {// Point B
                     //alert("To Part no. has been changed. Please enter it again.");
                     var msg = document.getElementById("alertMessage");
                     msg.innerHTML = "To Part no. has been changed. Please enter it again.";
                     var myExtender = $find("ctl00_ContentPlaceHolder1_ModalPopupExtenderAlert");
                     myExtender.show();
                     document.getElementById("&lt;%= txtToPartNumber.ClientID %&gt;").focus();
                     return false;
                 }
             }
             else 
             {
                 //window.alert("Please choose a Valid To Part number");
                 var msg = document.getElementById("alertMessage");
                 msg.innerHTML = "Please choose a Valid To Part number.";
                 var myExtender = $find("ctl00_ContentPlaceHolder1_ModalPopupExtenderAlert");
                 myExtender.show();
                return false;
             }
         }
         else 
         {
             //alert("From Part no. has been changed.Please enter it again.");
             var msg = document.getElementById("alertMessage");
             msg.innerHTML = "From Part no. has been changed.Please enter it again.";
             var myExtender = $find("ctl00_ContentPlaceHolder1_ModalPopupExtenderAlert");
             myExtender.show();
             document.getElementById("&lt;%= txtFromPartNumber.ClientID %&gt;").focus();
             return false;
         }
     }
     else 
     {
         //window.alert("Please choose a Valid From Part number");
         var msg = document.getElementById("alertMessage");
         msg.innerHTML = "Please choose a Valid From Part Number.";
         var myExtender = $find("ctl00_ContentPlaceHolder1_ModalPopupExtenderAlert");
         myExtender.show();
         return false;
     }
 }
</code></pre>
