title: Fill a textbox with the current date in dd/mm/yy format on formload
body: <p>I am trying to set default date to a textbox inside my asp.net web form, using jquery on form load.For that I am using the function :</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;body onload="myFunction()"&gt;
  &lt;input type="text" class="form-control" placeholder="dd/mm/yyyy" autocomplete="off" id="datepicker2" name="datepicker2" /&gt;
  &lt;p id="demo"&gt;&lt;/p&gt;
  
  &lt;script&gt;
  function myFunction() {
      var d = new Date();
      var n = d.toLocaleDateString();
      document.getElementById("datepicker2").defaultValue = n;
  }
  &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>But when I added this to my solution date format changes to mm/dd/yyyy , where I am expecting it in dd/mm/yyyy format.<br> </p>
  
  <p>why this <code>toLocaleDateString();</code> is not working on my solution ?
  <code>datepicker2</code> is a <code>datepicker</code> . I have a function <code>datepicker()</code> for calendar view which also gives output in dd/mm/yyyy format when i select a date using mouse.</p>
  
  <p>So,how can I fill datepicker2 with Current date in dd/mm/yyyy format ???? <br>
  Note: This issue happens <strong>only when I am using FireFox</strong> !! </p>