this is my ajax code that work perfectly if i show using an id.
$("#masa").change(function()
{ //if theres a change in the nokakitangan textbox
var masa = $("#masa").val();
var tkh_kerja = $("#tkh_kerja").val();
//Get the value in the nokakitangan textbox
if(tkh_kerja=='')
{
$("#cek_tarikh").html('<font color="Red"> Sila Isi Maklumat Tarikh Mula Bekerja </font>');
}
else
{
$("#cek_tarikh").html('<align="absmiddle"> Cek Tarikh Akhir...');
$.ajax
({ //Make the Ajax Request
type: "POST",
url: "ajax_cek_tarikhakhir.php", //file name
data: "bulan="+ masa +"&tkh_kerja="+tkh_kerja, //data
success: function(cekmasa)
{
$("#cek_tarikh").ajaxComplete(function(event, request)
{
$("#cek_tarikh").val(cekmasa);
});
}
});
}
return false;
});
the problem is, can the 'cekmasa' value pass to the php.? i need to use that value to do some code in php. is it possible to get the data from ajax? in the same page.
there is no problem when i return value in
<input align='right' type="text" name="tkh_akhir" maxlength="3" id="cek_tarikh" class="span2" readonly/>