javascript - DatePicker/Timepicker is Visible all the time -


i have fields datepicker & timepicker. whenever move page last used datepicker or timepicker visible time. example if had used timepicker on page, whenever going page timepicker open.

my requirement when click on textbox datepicker or timepicker should visible.

javascript function:

 $(document).ready(function () {             $("[id$=textbox1]").pickadate({format: 'dd/mm/yyyy'});               $("[id$=textbox3]").pickatime({ interval: 10 });             $("[id$=textbox4]").pickatime({ interval: 10 });                     }); 

where should change code?

please me so.

thanks

update code:

for textbox1

<tr> <td class="style10">                     <strong>                 today                 </strong>                 </td>                 <td class="style13">                     <strong>                 <asp:textbox id="textbox1" runat="server"></asp:textbox>                     </strong>                 </td>             </tr> 

for textbox3

 <tr>     <td class="style10">                     <strong>                     in time:</strong></td>                 <td class="style13">                     <strong>                 <asp:textbox id="textbox3" runat="server"></asp:textbox>                      </strong>                  </td>             </tr> 

for textbox4

 <tr>                 <td class="style10">                     <strong>                 outtime:</strong></td>                 <td class="style13">                     <strong>                 <asp:textbox id="textbox4" runat="server" onkeyup="sum"></asp:textbox>                     </strong>                 </td>             </tr>             <tr> 

you can instantiate picker in var

var picker = $input.pickadate('picker') 

and open or close when want:

picker.open() picker.close() 

in way can each picker:

 $(document).ready(function () {            var picker =  $("[id$=textbox1]").pickadate({format: 'dd/mm/yyyy'});              }); 

and add 2 event handlers each input:

$('#textbox1').focus(function() {   picker.open() });  $('#textbox1').focusout(function() {   picker.close() }); 

if dont want declarate handler manually each input (can little toilsome), can create function parametrize this:

function parametrizehandlers(inputid, picker) {     $('#'+inputid).focus(function() {       picker.open()     });      $('#'+inputid).focusout(function() {       picker.close()     }); } 

important: im supose using api, full specification here:

api- pickadate.js

if you're not using api sure can this.


Comments

Popular posts from this blog

sql - invalid in the select list because it is not contained in either an aggregate function -

Angularjs unit testing - ng-disabled not working when adding text to textarea -

How to start daemon on android by adb -