After clicking send button. I have to pass these parameters to function but it is not working as I expected. If you understand it then please help. Below is button and function...
$pm_ui .= '<button type="submit" id="pmBtn" onclick="postPm(\''.$u.'\',\''.$log_username.'\',\'$pmsubject\',\'$pmtext\')">Send</button>';
function postPm(tuser,fuser,subject,ta){
var data = _(ta).value;
var data2 = _(subject).value;
if(data == "" || data2 == ""){
alert("Fill all fields");
return false;
}
_("pmBtn").disabled = true;
var ajax = ajaxObj("POST", "php_parsers/pm_system.php");
ajax.onreadystatechange = function() {
if(ajaxReturn(ajax) == true) {
if(ajax.responseText == "pm_sent"){
alert("Message has been sent.");
_("pmBtn").disabled = false;
_(ta).value = "";
_(subject).value = "";
} else {
alert(ajax.responseText);
}
}
}
ajax.send("action=new_pm&fuser="+fuser+"&tuser="+tuser+"&data="+data+"&data2="+data2);
}
But whenever I click on 'send' button it is not triggering function code is as following. If I am missing something then please help me to take my attention there..(button is not responding any thing...)