I create a form in that I want to use onblur and onkeypress in same line.
Is it possible?
<?php
echo $form->textField($model, 'amount', array('name'=>'amount','onblur'=>'return checkallfield()', 'id'=>'amnt'));
?>
Where to give onkeypress?
I create a form in that I want to use onblur and onkeypress in same line.
Is it possible?
<?php
echo $form->textField($model, 'amount', array('name'=>'amount','onblur'=>'return checkallfield()', 'id'=>'amnt'));
?>
Where to give onkeypress?
Just add it like you added onblur
, as:
$form->textField($model,
'amount',
array(
'name'=>'amount',
'onblur'=>'return checkallfield();',
'onkeypress'=>'return doKeyPress();',
'id'=>'amnt'
)
);