0
我正在爲我的應用程序使用JQuery和cakephp。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;});
}
});
});
而創建就像一個,,
<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>
我不知道爲什麼值未設置像
<option value="Below 5 Yrs">Below 5 Yrs</option>
請建議我...我知道有一些問題在引號中,我嘗試了很多選項...
什麼是** ** HT返回(原始輸出)? – TheVillageIdiot 2009-09-01 07:20:39