Forms kohana表单助手包括javascript

Forms kohana表单助手包括javascript,forms,kohana,kohana-3,form-helpers,Forms,Kohana,Kohana 3,Form Helpers,我使用kohana helper在视图中创建表单,但我需要在某些字段中包含一些javascript(如onclick、onblur等)。我如何在不放弃kohana form helper的情况下做到这一点 例如,在纯html中,我有: <input class="field" type="text" id="email" name="email" value="<?php if (Cookie::get('email')) echo Cookie::ge

我使用kohana helper在视图中创建表单,但我需要在某些字段中包含一些javascript(如onclick、onblur等)。我如何在不放弃kohana form helper的情况下做到这一点

例如,在纯html中,我有:

               <input class="field" type="text" id="email" name="email" value="<?php if (Cookie::get('email')) echo Cookie::get('email'); else echo 'Adresă Email'; ?>" onclick="if (this.value=='Adresă Email') this.value='';" onblur="if (this.value=='') this.value='Adresă Email';" />

只需将onclick、onblur添加到属性数组:

echo Form::input('email', $email_value, array('onlick' => 'something;', 'onblur' => 'something else;'))

或考虑使用和停止担心内联属性;p> 对。改为使用jquery:)

echo Form::input('email', $email_value, array('onlick' => 'something;', 'onblur' => 'something else;'))