this is my array
$m3 = array
(
'2' => '2',
'4' => '4',
'6' => '6',
'9' => '9',
'14' => '14',
'18' => '18',
'20' => '20',
'other' => 'other'
);
How do I get 'other' to change in what I put in the inputfield 'other_interest'?
<?=$form->input('Car/m3', array('name' => "other_interest", 'style' => "display:none", 'class' => 'inputText', 'label' => false));?>
The jQuery shows the inputfield when I choose other
<script>
jQuery(document).ready(function() {
jQuery("#CarM3").change(function() {
if (jQuery(this).val() === 'other'){
jQuery('input[name=other_interest]').show();
} else {
jQuery('input[name=other_interest]').hide();
}
});
});
</script>
What I understand from your question is that, you want "other" to be displayed in the inputfield : "other_interest".