{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/10033","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/10033/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/10033/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/10033/events","html_url":"https://github.com/yiisoft/yii2/issues/10033","id":113742315,"number":10033,"title":"enableAjaxValidation per field has no way to determine the field on server","user":{"login":"jpodpro","id":15255854,"avatar_url":"https://avatars.githubusercontent.com/u/15255854?v=3","gravatar_id":"","url":"https://api.github.com/users/jpodpro","html_url":"https://github.com/jpodpro","followers_url":"https://api.github.com/users/jpodpro/followers","following_url":"https://api.github.com/users/jpodpro/following{/other_user}","gists_url":"https://api.github.com/users/jpodpro/gists{/gist_id}","starred_url":"https://api.github.com/users/jpodpro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jpodpro/subscriptions","organizations_url":"https://api.github.com/users/jpodpro/orgs","repos_url":"https://api.github.com/users/jpodpro/repos","events_url":"https://api.github.com/users/jpodpro/events{/privacy}","received_events_url":"https://api.github.com/users/jpodpro/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-28T04:44:57Z","updated_at":"2015-10-30T21:11:10Z","closed_at":null,"body":"i have enableAjaxValidation enabled on several specific form fields that each have different kinds of complicated validation. the problem is that, when the ajax request hits the server, there is nothing in the request that identifies which field has triggered the ajax validation request. the request contains all the fields in the form along with ajax:form-name\r\n\r\nsince each of my custom validations is complex and involves a bit of wait time (as it makes additional requests of its own), every time ajax validation is run on ANY of the fields that trigger it, all of the validations are run instead of the single validation required.\r\n\r\ni have a work-around where, using an event handler for beforeValidateAttribute, i can set a hidden form field to the name of the field that is triggering the update. then the server can see which field to individually validate and perform accordingly. however it seems obvious to me that this should not have to be done by the user."},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/152652415","html_url":"https://github.com/yiisoft/yii2/issues/10033#issuecomment-152652415","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/10033","id":152652415,"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-10-30T21:11:10Z","updated_at":"2015-10-30T21:11:10Z","body":"I'm not sure how do it keeping backwards compatibility. Also if done, it would mean validation would be different when serverside and when AJAX which mean double amount of code.\r\n\r\nDo you have ideas on how to solve it?"}}