Hi, I need to remove fields from a form when it’s in Create mode versus Update mode. Is this done in the Controller?
Thanks.
Aaron
Hi, I need to remove fields from a form when it’s in Create mode versus Update mode. Is this done in the Controller?
Thanks.
Aaron
i would
do it at where fields belong = view.
use $model->isNewRecord to detect if it’s create vs update.
yes as rootbear say you can put that field code under $model->isNewRecord condition so the field visible under certain condition ( on create/update ).
Thankx…
[size="2"][color="#1c2837"]you can write conditionin view then only visible field can be Putted in side[/color][/size]
[size="2"][color="#1c2837"]<?php[/color][/size][color=#1C2837][size=2]if($model->isNewRecord)[/size][/color]
[color=#1C2837][size=2]{[/size][/color]
[color=#1C2837][size=2]?>[/size][/color]
[color=#1C2837][size=2]<div id="row" >[/size][/color]
[color=#1C2837][size=2]–*******[/size][/color]
[color=#1C2837][size=2]</div>[/size][/color]
[color=#1C2837][size=2]
[/size][/color]
[color=#1C2837][size=2]<?php[/size][/color]
[color=#1C2837][size=2]
[/size][/color]
[color=#1C2837][size=2]?>[/size][/color]