I have a php array as below :
$city_more = $form->select("GalStore.gal_location_id", $gal_locations,null,$city_attributes);
which produces var_dump($city_more)
:
string '<select name="data[GalStore][gal_location_id]" id="locations_list">
<option value="">--- Select City ---</option>
<option value="11">Ahmedabad</option>
<option value="31">Aijwal</option>
<option value="3">Bangalore</option>
<option value="26">Bhopal</option>
<option value="9">Bhubaneswar</option>
<option value="30">Bidar</option>
<option value="10">Chandigarh</option>
<option value="4">Chennai</option>
<option value="1">Delhi - NCR</option>
<option value="34">Dhaka</option>
<option value="21">Dimapur</optio'... (length=1426)
I want to use this array in a javascript function :
$('#add_more_city').click(function(){
var city = '';
alert(<?php echo $city_more; ?>);
});
But its not alerting anything ! Is my process is wrong ?
Uncaught ReferenceError
orUncaught SyntaxError
perhaps?json_encode()
.select
string? or what?