echo $ form-> input ('field', array ( 'type' => 'radio', 'legend' => $ r ['Attribute'] [' label '],
'separator' => '--separator--',
'options' => array()
));
Comment interroger les options à l'intérieur pour récupérer les options de la base de données pour ce correspondant champs .. comme envoyer son attribute_id par $ r [' attribut '] [' id '] et aller chercher les choix cooresponding pour cet attribut .. Je l'ai essayé avec Ajax poster comme
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);
return i.choice;});
Et il me renvoie les choix dans le i.choice .. mais je ne sais pas comment placer ce à l'intérieur du tableau d'options ... S'il vous plaît me suggérer ....
dupliquer: http://stackoverflow.com/questions/1393164/fix-the-options-in-cakephp-form-field-of-type-radio-button – deizel