2015-06-14 77 views
0

我有一些麻煩hidding使用form_dropdown
如何隱藏每個j_status行==接近,則該選項標籤可以被隱藏的選項標籤隱藏選項值
這裏是我的腳本如何使用form_dropdown在笨

<?php 
$dev=''; 
foreach($j as $r) 
{ 
    if(($r->j_status)=='open') 
     $dev='echo ""'; 
    else if(($r->j_status)=='close') 
     $dev='echo hidden'; 
} 
    echo form_dropdown("id_j",$list_jid,"default",$dev,"id='some_id'"); 
?> 
+0

你爲什麼循環它並在循環外回顯form_dropdown? –

+0

呃,嗯,我已經改變了form_dropdown技術,以簡單的選擇選項html模式,並解決了問題.. –

回答

0
<?php 
$dev=''; 
foreach($j as $r) 
{ 
    if(($r->j_status)=='open') 
     $dev='echo ""'; 
    else if(($r->j_status)=='close') 
     $dev='echo hidden'; 
echo form_dropdown("id_j",$list_jid,"default",$dev,"id='some_id'");//place here 
} 

?> 
  1. Form Helper
  2. form Validation