Jump to content

Jquery won't work after Ajax call


lalnfl

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.