Passing javascript to php varaiable

I want to pass total value to label as php varable

<button type="button" class="button" onClick="fnIntTotal()">Internal Total =</button>	 	 
			function fnIntTotal(){						
			var a = document.getElementById('txt_Lab').value;
			var b = document.getElementById('txt_Sample').value;
			var c = document.getElementById('txt_Wastage').value;	
			var total = parseInt(a || 0) + parseInt(b || 0) + parseInt(c || 0);
				if (isNaN(a) || isNaN(b) || isNaN(c))
					document.getElementById("inttotal").style.color = "red"; 
					document.getElementById('inttotal').innerHTML="Enter a valid Number";					
					document.getElementById("inttotal").style.color = "green";
			<label id='inttotal' name='inttotal' ></label>

set it in a form then POST, or AJAX.

not working through post,
send me ajax sample code

works perfect

try it yourself, just google “PHP AJAX”.

Yeah not happening…

Sponsor our Newsletter | Privacy Policy | Terms of Service