دنبال کننده ها

۱۳۹۶ آذر ۱۱, شنبه

How to use php loop foreach inside jquery

[ad_1]



I want to bring the data from the database in the dropdown using button with the query of append.The code is running without the loop (foreach) but not with the loop . I also want to toggle the dropdown using jquery toggle function.




$(document).ready(function(){

$('#timetable').hide();
$('#timeSection').click(function()
$(this).next('#timetable').toggle(500) );
// alert('working');

$('#addHospital').click(function(){

var addTable = '" Select Hospital: 0)


foreach ($lists['res2'] as $row)

?> hos_id?>"> hos_name; ?> "';

$('#addTbl').append(addTbl);
);
);




[ad_2]

لینک منبع