How to show an input after doing $ajax->observeField
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.
精彩评论