0

I am trying to transfer a value automatically from selection input area to another input area when the selection input has changed. 但是我不能。请帮我。代码在这里:

<?php
        echo $this->Form->input('treatment', 
            array('options' => $types, 'id' => 'treatment_foo'));
        echo $this->Form->input('fee', array('id' => 'fee_foo'');

        echo $this->Js->get('#treatment_foo')->event('change',
            $this->Js->request(
                array( 
                    'update' => '#fee_foo',
                    'dataExpression' => true,
                    'data' => '10'))
            );

    ?>
4

1 回答 1

0

只需使用一些 JQuery

$(document).ready(function() {
    $('#treatment_foo').change(function() {
        $('#fee_foo').val($('#treatment_foo').val());
    });
});
于 2013-02-11T18:28:12.190 回答