On change of the dropdown list, A php function should called.
Inside the PHP function I will do some calculation. Later I need to set the value of a text box or else that PHP function should return a value that value shoul be catch in the javascript and set that valu to the textbox control.
My html function is
<select name="sltLeaveType" id="sltLeaveType" class="formSelect" onchange="TotalCountsOfPL(this.value)">
<?php
<option></option>
<option></option>
</select>
And in PHP function is placed in D:/Project/EmployeeDetails/EmpLeave.php
class clsGetTotalPL
{
function GetTotalPL($EmployeeId)
{
$query = "select count(leave_request_id) from hs_hr_leave_requests where leave_type_id='LTY002' AND employee_id=".$EmployeeId.";";
return $query;
}
So now please [prvide me the JQuery function to call this Php function
to get call the GetTotalPL() function on every change on the the dropdownlist.
You can’t call a php function from js or html, but you can do that by ajax call to a php function where you can perform your calculation and then return the result value to js, so then you can do by js to html…
Update: