Adding function is disabling other functions in the js file
<p>I had this function in a js file and everything was working just fine :</p>

<pre><code>function check_acco_form()
{
    var name=$("#name").val();
       var institution=$("#institution").val();
       var year=$("#year").val();

       //PNR Data
    var pnr1=$("#pnr1").val();
    var pnr2=$("#pnr2").val();
    // Arrival date info
    var arr_year=$("#arr_year").val();
    var arr_month=$("#arr_month").val();
    var arr_date=$("#arr_date").val();
    //Departure date info
    var dep_year=$("#dep_year").val();
    var dep_month=$("#dep_month").val();
    var dep_date=$("#dep_date").val();

    var numericExpression = /^[0-9]+$/;

       //Name, institution and year must not be empty
       if(name=="" || institution=="" || year=="")
    {
        alert("One or more fields are empty.");
              return;
       }
    //PNR must be all numbers
    if(!pnr1.match(numericExpression) || !pnr2.match(numericExpression))
    {   
        alert("A PNR number consists of 10 digits only. Please enter again.");
        $("#pnr1").val("");
        $("#pnr2").val("");
        return;
    }
    if(pnr1.length!=3 || pnr2.length!=7)
    {
        alert('Invalid PNR Number.');
        $("#pnr1").val("");
        $("#pnr2").val("");
        return;
    }

    if((arr_month==dep_month &amp;&amp; dep_date&lt;arr_date) || (dep_month&lt;arr_month))
    {
        alert('Invalid dates.Please check again.');
        return;
    }

    //Test passed. Store in database;
    URL="saveAcco.php";
    parameters="name="+name+"&amp;ins="+institution+"&amp;year="+year+"&amp;pnr="+pnr1+""+pnr2+"&amp;dateArr="+arr_year+"-"+arr_month+"-"+arr_date+"&amp;dateDep="+dep_year+"-"+dep_month+"-"+dep_date;
    $.get(URL+"?"+parameters,function(data){
        $("#msg_box").html(data);
        if(data=="Your changes have been saved." || data=="Your data has been saved and is pending approval.")
              {
            $("#acco_status").html('&lt;br/&gt;&lt;b&gt;Accomodation Approval Status&lt;/b&gt; : &lt;span style="padding:3px;background-color:#f4fb3c"&gt;Approval Pending&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;');
              }
        $("#msg_box").fadeIn("slow",function(){
            setTimeout('fadeOutMsgBox();',3000);
              });
          });
}
</code></pre>

<p>I made a little changes to this function (added the variables 'mobile_num' and 'train_num', included 'if' conditions to make sure the user enters numbers only and made changes to the jQuery get function) that which resulted in the following code:</p>

<pre><code>function check_acco_form()
{
    //Personal Information
    var name=$("#name").val();
    var institution=$("#institution").val();
    var year=$("#year").val();

    //Contact Information
    var mobile_num=$("#mobile").val();

       //PNR Data
    var pnr1=$("#pnr1").val();
    var pnr2=$("#pnr2").val();

    //Train Number
    var train_num=$("#trainnum").val();

    // Arrival date info
    var arr_year=$("#arr_year").val();
    var arr_month=$("#arr_month").val();
    var arr_date=$("#arr_date").val();
    //Departure date info
    var dep_year=$("#dep_year").val();
    var dep_month=$("#dep_month").val();
    var dep_date=$("#dep_date").val();

    var numericExpression = /^[0-9]+$/;

    //Name, institution and year must not be empty.
    if(name=="" || institution=="" || year=="")
    {
        alert("One or more fields are empty.");
        return;
    }

    //PNR can be empty but if entered must be all numbers
    if(pnr1!="" and pnr2!="")
    {
        if(!pnr1.match(numericExpression) || !pnr2.match(numericExpression))
        {   
            alert("A PNR number consists of 10 digits only. Please enter again.");
            $("#pnr1").val("");
            $("#pnr2").val("");
            return;
        }

        if(pnr1.length!=3 || pnr2.length!=7)
        {
            alert('Invalid PNR Number.');
            $("#pnr1").val("");
            $("#pnr2").val("");
            return;
        }
    }

    //Train number can be empty but if entered must be all numbers
    if(train_num!="")
    {
        if(!train_num.match(numericExpression))
        {   
            alert("Train number must consits of digits only");
            $("#trainnum").val("");
            return;
        }
    }

    //Mobile num can be empty but must be all numbers
    if(mobile_num!="")
    {
        if(!mobile_num.match(numericExpression))
        {
            alert("Invalid mobile number");
            $("#mobile_num").val("");
            return;
        }
        if(mobile_num.length!=10)
        {
            alert('A mobile number consists of 10 digits.Please enter again.');
            return;
        }
    }

    if((arr_month==dep_month &amp;&amp; dep_date&lt;arr_date) || (dep_month&lt;arr_month))
    {
        alert('Departure date cannot be before arrival date.Please check again.');
        return;
    }

    //Test passed. Store in database;
    URL="saveAcco.php";
    parameters="name="+name+"&amp;ins="+institution+"&amp;year="+year+"&amp;pnr="+pnr1+""+pnr2+"&amp;dateArr="+arr_year+"-"+arr_month+"-"+arr_date+"&amp;dateDep="+dep_year+"-"+dep_month+"-"+dep_date+"&amp;mobile="+mobile_num+"&amp;train_num="+train_num;
    $.get(URL+"?"+parameters,function(data){
        $("#msg_box").html(data);
        if(data=="Your changes have been saved." || data=="Your data has been saved and is pending approval.")
              {
            $("#acco_status").html('&lt;br/&gt;&lt;b&gt;Accomodation Approval Status&lt;/b&gt; : &lt;span style="padding:3px;background-color:#f4fb3c"&gt;Approval Pending&lt;/span&gt;&lt;br/&gt;&lt;br/&gt;');
            $("#acco_letter_print").html('Download accomodation letter &lt;a href="PDF/acco_print.php" target="_blank"&gt;here&lt;/a&gt;');
            $("#acco_letter_print").fadeIn();           
              }
        $("#msg_box").fadeIn("slow",function(){
            setTimeout('fadeOutMsgBox();',3000);
              });
          }); //End of get function

}
</code></pre>

<p>After the changes, suddenly all functions in the js file of this function have stopped working including this function. On searching the forum , I found this discussion : <a href="http://stackoverflow.com/questions/2804913/javascript-function-causing-all-other-functions-not-to-work-inside-js-file">JavaScript function causing all other functions not to work inside js file</a> which says that the error may be due to use of reserved words. However , I can't find any reserved words used as variables in my code. Any ideas what may the problem?</p>
