javascript - jQuery widget Inside jQuery ajax tabs -


i'm having problems adding datepicker ajax loaded site on tab widget. i'll try explain have done far.

i have first made forms , stuff, added datepicker , made sure worked. wanted create tab widget wich load page form it. while work , $_post stuff works too, jquery doesn't seem work.

are there know causes or specific problem related me?

if code needed figure out i'll edit later, want know if it's possible.

please keep in mind relatively new jquery , ajax stuff. in advance!

--edit--

note: include scripts in headers of each page.

page tabs:

view

<div id="tabs"> <ul>     <li><a href="../tabs/bericht">bericht</a></li>     <li><a href="../main/initiative">initiatief</a></li>     <li><a href="../main/profile">interesse</a></li> </ul> 

java

$(document).ready(function(){ $( "#tabs" ).tabs({collapsible:true, active:false, effect:'ajax'}); }); 

loaded page:

$(document).ready(function(){ $('#date').datetimepicker({dateformat: 'yy/mm/dd'});  var counter = 1;  $("#addbutton").click(function () {      if(counter>10){             alert("only 10 textboxes allow");             return false;     }         var newtextboxdiv = $(document.createelement('div'))          .attr("id", 'textboxdiv' + counter);      newtextboxdiv.after().html('<input type="text" name="requirements' + counter + '" id="requirements' + counter + '" value="" >&nbsp;<input type="text" name="requirementscount' + counter + '" id="requirementscount' + counter + '" value="" size="2"><br>');      newtextboxdiv.appendto("#textboxesgroup");       counter++;  });   $("#removebutton").click(function () { if(counter==1){       alert("no more textbox remove");       return false;    }     counter--;      $("#textboxdiv" + counter).remove();   }); }); 

(is enough make work?)

you have used datepicker function on document ready, @ time date element doesn't registered in dom, make datepicker work properly, have call $('#date').datetimepicker({dateformat: 'yy/mm/dd'}) function after ajax content loaded.

for have class tabs callback method "load"

$(document).ready(function(){ $( "#tabs" ).tabs({ load: function( event, ui ) {     if($('#date').length>0){                 $('#date').datetimepicker({dateformat: 'yy/mm/dd'});     } } }); }); 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -