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

AbotX : How do you create a parallel crawler that stays on and can be added to at run time from new requests -

testing - Detect whether test has failed within fixture -

android - Create single AAR file from multiple modules using Gradle -