{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/6975","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/6975/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/6975/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/6975/events","html_url":"https://github.com/yiisoft/yii2/issues/6975","id":55169414,"number":6975,"title":"Suggestion/Ideia: yii.activeForm validateOnType","user":{"login":"llfm","id":8844652,"avatar_url":"https://avatars.githubusercontent.com/u/8844652?v=3","gravatar_id":"","url":"https://api.github.com/users/llfm","html_url":"https://github.com/llfm","followers_url":"https://api.github.com/users/llfm/followers","following_url":"https://api.github.com/users/llfm/following{/other_user}","gists_url":"https://api.github.com/users/llfm/gists{/gist_id}","starred_url":"https://api.github.com/users/llfm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/llfm/subscriptions","organizations_url":"https://api.github.com/users/llfm/orgs","repos_url":"https://api.github.com/users/llfm/repos","events_url":"https://api.github.com/users/llfm/events{/privacy}","received_events_url":"https://api.github.com/users/llfm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yiisoft/yii2/labels/status:ready%20for%20adoption","name":"status:ready for adoption","color":"02e10c"},{"url":"https://api.github.com/repos/yiisoft/yii2/labels/type:enhancement","name":"type:enhancement","color":"d7e102"}],"state":"open","locked":false,"assignee":{"login":"samdark","id":47294,"avatar_url":"https://avatars.githubusercontent.com/u/47294?v=3","gravatar_id":"","url":"https://api.github.com/users/samdark","html_url":"https://github.com/samdark","followers_url":"https://api.github.com/users/samdark/followers","following_url":"https://api.github.com/users/samdark/following{/other_user}","gists_url":"https://api.github.com/users/samdark/gists{/gist_id}","starred_url":"https://api.github.com/users/samdark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samdark/subscriptions","organizations_url":"https://api.github.com/users/samdark/orgs","repos_url":"https://api.github.com/users/samdark/repos","events_url":"https://api.github.com/users/samdark/events{/privacy}","received_events_url":"https://api.github.com/users/samdark/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/yiisoft/yii2/milestones/12","html_url":"https://github.com/yiisoft/yii2/milestones/2.0.4","labels_url":"https://api.github.com/repos/yiisoft/yii2/milestones/12/labels","id":929989,"number":12,"title":"2.0.4","description":"","creator":{"login":"cebe","id":189796,"avatar_url":"https://avatars.githubusercontent.com/u/189796?v=3","gravatar_id":"","url":"https://api.github.com/users/cebe","html_url":"https://github.com/cebe","followers_url":"https://api.github.com/users/cebe/followers","following_url":"https://api.github.com/users/cebe/following{/other_user}","gists_url":"https://api.github.com/users/cebe/gists{/gist_id}","starred_url":"https://api.github.com/users/cebe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cebe/subscriptions","organizations_url":"https://api.github.com/users/cebe/orgs","repos_url":"https://api.github.com/users/cebe/repos","events_url":"https://api.github.com/users/cebe/events{/privacy}","received_events_url":"https://api.github.com/users/cebe/received_events","type":"User","site_admin":false},"open_issues":58,"closed_issues":58,"state":"open","created_at":"2015-01-10T21:15:11Z","updated_at":"2015-03-20T16:30:13Z","due_on":"2015-05-03T04:00:00Z","closed_at":null},"comments":19,"created_at":"2015-01-22T15:51:16Z","updated_at":"2015-03-21T05:23:01Z","closed_at":null,"body":"I don't know if it's a valid point or if it's better to keep the things cleaner.\r\nWhen a field has validateOnType and the user _moves_ the cursor with the _arrows_, (a lot of people do that) a request is [made](https://github.com/yiisoft/yii2/blob/master/framework/assets/yii.activeForm.js#L410).\r\n\r\n```javascript\r\nif (attribute.validateOnType) {\r\n    $input.on('keyup.yiiActiveForm', function () {\r\n    //Any key pressed.\r\n    if (attribute.value !== getValue($form, attribute)) {\r\n        validateAttribute($form, attribute, false, attribute.validationDelay);\r\n}\r\n```\r\n\r\nPerhaps it would be nice (if it's worth it) to do something like [this](http://stackoverflow.com/questions/3977642/how-to-know-if-keyup-is-a-character-key-jquery/12511097#12511097) or check the arrow keycode.\r\n\r\n```javascript\r\n$(\"#input\").keyup(function(event) {\r\n    var searchText = $.trim($(\"#input\").val());\r\n    \r\n    var c= String.fromCharCode(event.keyCode);\r\n    var isWordCharacter = c.match(/\\w/);\r\n    var isBackspaceOrDelete = (event.keyCode == 8 || event.keyCode == 46);\r\n\r\n    if((isWordCharacter || isBackspaceOrDelete) && searchText.length > 2) { \r\n        ...\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/84257853","html_url":"https://github.com/yiisoft/yii2/issues/6975#issuecomment-84257853","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/6975","id":84257853,"user":{"login":"samdark","id":47294,"avatar_url":"https://avatars.githubusercontent.com/u/47294?v=3","gravatar_id":"","url":"https://api.github.com/users/samdark","html_url":"https://github.com/samdark","followers_url":"https://api.github.com/users/samdark/followers","following_url":"https://api.github.com/users/samdark/following{/other_user}","gists_url":"https://api.github.com/users/samdark/gists{/gist_id}","starred_url":"https://api.github.com/users/samdark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samdark/subscriptions","organizations_url":"https://api.github.com/users/samdark/orgs","repos_url":"https://api.github.com/users/samdark/repos","events_url":"https://api.github.com/users/samdark/events{/privacy}","received_events_url":"https://api.github.com/users/samdark/received_events","type":"User","site_admin":false},"created_at":"2015-03-21T05:23:01Z","updated_at":"2015-03-21T05:23:01Z","body":"Thank you!"}}