I want to create my own dropdown field. I use lookup table and i want to replace with own code on Lookup_Selecting function:
if ($fld->Name == "yearfield"){
$th = date("Y");
$ar_th = "[";
for($x=2010;$x<=$th;$x++){
$coma = ",";
if($th == $x){
$coma = "";
}
$ar_th .= "[".$x.",".$x."]".$coma;
}
$ar_th .= "]";
//echo $ar_th; exit();
$fld->Lookup->setOptions($ar_th);
}
what's wrong so it doesn't appear on the my dropdown?