lalnfl Posted June 27, 2011 Share Posted June 27, 2011 Javascript Code: $(document).ready(function(){ // selecting worker if (!document.getElementById("worker_id").value){ document.getElementById("worker_content").innerHTML="<div class='inner_right'>Select a worker to view.</div>"; } $("#worker_id").change(function(){ if (!document.getElementById("worker_id").value){ document.getElementById("worker_content").innerHTML="<div class='inner_right'>Select a worker to view.</div>"; } else { var worker_id = $("#worker_id").val(); $.post("get_worker.php", {worker_id : worker_id}, function(data){ $("#worker_content").html(data); }); } }); // mark down / mark up $("#mark_up").click(function(){ var wage = $("#wage").val(); $("#wage_display").html(wage); }); }); Ajax Callback HTML part: <input type='hidden' name='contract_wage' id='wage' value='$wage' /> <span id='wage_display'>$$wage</span> <input class='form' type='button' name='mark_up' id='mark_up' value='Mark Up' /> What is causing it to not function? Link to comment https://forums.phpfreaks.com/topic/240493-jquery-wont-work-after-ajax-call/ Share on other sites More sharing options...
gristoi Posted June 27, 2011 Share Posted June 27, 2011 where are you declaring the id worker_id? Link to comment https://forums.phpfreaks.com/topic/240493-jquery-wont-work-after-ajax-call/#findComment-1235337 Share on other sites More sharing options...
lalnfl Posted June 27, 2011 Author Share Posted June 27, 2011 I seemed to have fixed my problem by placing the javascript code that I want to run with the ajax callback in that. Link to comment https://forums.phpfreaks.com/topic/240493-jquery-wont-work-after-ajax-call/#findComment-1235549 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.