0
J'utilise JQuery et cakephp pour mon application.Citations d'utilisation dans JQuery
I have created a select input Element using
$(document).ready(function(){
$("#"+<?=$r['Attribute']['id'];?>).each(function() {
type= "<?=$r['Attribute']['type'];?>";
attribute_id= "<?=$r['Attribute']['id'];?>";
if(type=="dropdown")
{
var ht = $.ajax({
type: "GET",
url: "http://localhost/FormBuilder/index.php/forms/viewChoices/"
+ attribute_id,
async: false
}).responseText;
var myObject = eval('(' + ht + ')');
var data = myObject;var j=0;
$.map(data.choices, function(i){ j++; alert(i.choice);
$('<option value='+i.choice+'>'+i.choice+'</option>')
.appendTo("#"+<?=$r['Attribute']['id'];?>);
return i.choice;});
}
});
});
Et celui qui a créé est comme ,,
<select id="10" name="Experience">
<option value="Fresher">Fresher</option>
<option yrs="" 5="" value="Below">Below 5 Yrs</option>
<option yrs="" 10="" value="Above">Above 10 yrs</option>
</select>
Je ne sais pas pourquoi la valeur est définie comme
<option value="Below 5 Yrs">Below 5 Yrs</option>
S'il vous plaît me suggérer ... Je sais qu'il ya un problème entre guillemets et j'ai essayé avec beaucoup d'options ...
ce qui est retourné en ** ht ** (la sortie brute)? – TheVillageIdiot