Input value doesn't display. How is that possible?

后端 未结 13 2209
后悔当初
后悔当初 2021-02-04 23:54

This must be something utterly stupid that I\'ve done or am doing, but I have an input with a value attribute that simply isn\'t being displayed:

13条回答
  •  無奈伤痛
    2021-02-05 00:35

    Are you confusing the uses of the 'default' and the 'value' parameters for $html->input()?

    If you're are using 'default' => $product['Product']['make'] and $this->data is present, the field will not be populated. The purpose of the 'default' parameter is to display a default value when no form data ($this->data) is present.

    If you want to force display of a value, you should use the 'value' parameter instead. 'value' => $product['Product']['make']

提交回复
热议问题