calling of javascript function on datepicker input tag working on second action
<p>I am taking on input tag that is calling a datepicker script for date. Now on onblur event of input tag, i am calling a javascript function that is working properly but on second time when i click on datepicker input for selecting value.</p>

<p>For the first time when i click on input tag and select a value from datepicker, nothing happens. But second time when i click on input tag and select a value from datepicker then my javascript function is working.</p>

<p>Here is the code:</p>

<pre><code>// HTML code for input tag using datepicker script

&lt;div class="input-append"&gt;
    &lt;input type="text" size="12"  id="inputField" name="event_fromdate" readonly Placeholder="From Date" onblur="show_hide_fromdate();" /&gt;  
&lt;/div&gt;

 // javascript function

 function show_hide_fromdate()
 {
     var fromdate=$('#inputField').val();
     var current_date = new Date();
     var userdate = new Date(fromdate);

     if(fromdate=="")
     {
         document.getElementById('msgFromDate').innerHTML = 'Enter From Date.';
     }
     else
     { 
         if(current_date.getDate()&gt;userdate.getDate() || 
            current_date.getMonth()&gt;userdate.getMonth() || 
            current_date.getFullYear()&gt;userdate.getFullYear())
         {
             document.getElementById('msgFromDate').innerHTML = 'Invalid event date';
         }
         else
         {
             $('#msgFromDate').html('');
         }
     }
 }
</code></pre>

<p>Not getting the fault in this code.</p>
