开发者

How to show an input after doing $ajax->observeField

开发者 https://www.devze.com 2023-01-22 03:18 出处:网络
I have a form with two inputs: echo $this->Form->input(\'articulo_id\', array(\'empty\'=>\'---Select---\'));

I have a form with two inputs:

echo $this->Form->input('articulo_id', array('empty'=>'---Select---'));

echo $this->Form->input('numeral_id', array('empty'=>'---Select---', 'type'=>'hidden'));

When the first one changes state the second one gets updated and auto-populated; this is how it gets updated:

$options = array('url' => 'getArtNum', 'update' => 'EvidenciaNumeralId');

echo $ajax->observeField('EvidenciaArticuloId', $options);

The thing is that I need the second one to be shown after doing the update. Is there a way to do it?

I know if I just delete the 'type'=>'hidden' from the开发者_如何学JAVA form the input will be shown but I need it to stay hidden until the first one change.

Thanks in advance.


Maybe it's too late but maybe it helps other people with same problem.

You have to try callbacks:

$options['after'] = "$('EvidenciaNumeralId').show()";
echo $ajax->observeField('EvidenciaArticuloId', $options);

This should help.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号