I apreciate if someone can help
I used the demo of CFv5 to apply it to my form, all is working fine except that keys are not considered as keys, I have debugged it with firebug but I couldn't find the right conbination on this concatenation "=>", ":", "=" ????
[attachment=0]Captura.JPG[/attachment]
also I tried with Ajax tutorial code , but I couldn't make it working, get the response of Ajax with the array of fields but is not inserted in dropdown😲
I used the demo of CFv5 to apply it to my form, all is working fine except that keys are not considered as keys, I have debugged it with firebug but I couldn't find the right conbination on this concatenation "=>", ":", "=" ????
["Seleccione Hospital","18:Hospital San Agust\u00edn","19:Hospital Carmen\u00a0y Severo Ochoa","20:Hospital Comarcal de Jarrio","21:Hospital de Cabue\u00f1es","22:Hospital Cruz Roja Espa\u00f1ola de Gij\u00f3n","23:Hospital Valle del Nal\u00f3n","24:Hospital Universitario Central de Asturias","25:Hospital del Oriente de Asturias (Fundaci\u00f3n P\u00fablica Francisco Grande Covi\u00e1n)"]
<?php
$results = array();
$results[] = 'Seleccione Hospital';
foreach ( $form->data['hosp'] as $v ) {
$results[] = $v['id'].':'.$v['hospital'];
}
echo json_encode($results);
[attachment=0]Captura.JPG[/attachment]
also I tried with Ajax tutorial code , but I couldn't make it working, get the response of Ajax with the array of fields but is not inserted in dropdown😲
<?php
$results = array();
$results[] = '=??';
foreach ( $form->data['hosp'] as $v ) {
$results[] = $v['id'].'='.$v['hospital'];
}
$results = implode("\n", $results);
echo $results;
$mainframe =& JFactory::getApplication();
$mainframe->close();
?>