Yii Framework Forum: Deferred Support In Validation - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Deferred Support In Validation

#1 User is offline   alex-w 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 223
  • Joined: 25-November 10

Posted 23 August 2013 - 10:19 AM

I extended the FileValidator so I could validate images, dimensions etc.

I wanted to make use of some new HTML5 features so the image could be validated client side.
The only problem with this is checking the dimensions uses asynchronous methods (onload=function(){}) so you can't add any errors.

One way to help and make things more flexible would be to use jQuery deferred.
So a validator could return a deferred object which would hold off the successCallbacks until it's resolved.

thoughts?
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users