Open jsolivellase opened 9 years ago
Do you mean this peace of code?
var $selected = <?php echo json_encode($sensors); ?>;
$('#sensor_id').multiSelect('select', $selected);
Are you sure that $selected
is a string or an array? Only this types are accepted by select method.
hi sir , can you help me please i want to add values and txet from database by using $("#Order_No").load("DB-includes/fetch_campings.php?checkid=1"); and it stay empty and this my php code
function get_locations(){
$sql = "SELECT LocationID ,title from locations where Is_active=1 LIMIT 0 , 200";
$result = db_query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
// echo ""; i comment this line
echo "";
}
} else {
echo "<option value=''>لايوجد مواقع </option>";
} }
I have this code:
As you can see is a drop down list. I want to retrieve data from database cause is an edit form, all works except 'select' method, doesn't select anything (I tried 'select_all' and didn't work too). Am I doing something wrong?
P.D: I debugged script and values of $sensors wasn't wrong.