vivin / regula

Regula: An annotation-based form-validation framework in Javascript
126 stars 24 forks source link

setCustomValidity Fails in IE9 #32

Closed arthurkang closed 11 years ago

arthurkang commented 11 years ago

In IE 9.0.8112.16421, setCustomValidity fails. Two instances of that call in the regula js file. Those should be either tried and caught or some other check should be done prior to calling.

I'm using the latest 1.2.4 Snapshot

vivin commented 11 years ago

Hello Arthur,

The snapshot version is by no means complete, and is expected to contain errors and issues. :) I suggest downloading version 1.2.3. Specifically, I haven't fully implemented HTML5 validation and I wouldn't recommend using it in its current state (i.e., 1.2.4-SNAPSHOT). Furthermore, the direction I'm planning on going is if you want to use HTML5 validation with Regula, then you probably need a shim that implements the unimplemented features. At any rate, if you're going to be using HTML5 validation, you will need a shim because all browsers don't implement all of the features currently. The one I recommend using is html5forms; this is what I'm using to ensure that my QUnit tests work correctly.

arthurkang commented 11 years ago

I was previously using 1.2.3 and was having some issues with unbinding so I tried the SNAPSHOT release. I am NOT trying to implement HTML5 validation. Just tried to install 1.2.4 as a drop in replacement for 1.2.3. That failure in IE was the only thing that didn't work. Other browsers seem to work fine.

Anyways... I was just letting you know so that maybe other people who are testing out the SNAPSHOT wouldn't encounter the same issue...

Thanks and I really like what you've done.

Arthur

On 12/28/2012 7:11 PM, Vivin Paliath wrote:

Hello Arthur,

The snapshot version is by no means complete, and is expected to contain errors and issues. :) I suggest downloading version 1.2.3 https://github.com/vivin/regula/tree/v1.2.3. Specifically, I haven't fully implemented HTML5 validation. Furthermore, the direction I'm planning on going is if you want to use HTML5 validation with Regula, then you probably need a shim that implements the unimplemented features. At any rate, if you're going to be using HTML5 validation, you will need a shim because all browsers don't implement all of the features currently. The one I recommend using is html5forms https://github.com/zoltan-dulac/html5Forms.js; this is what I'm using to ensure that my QUnit tests work correctly.

— Reply to this email directly or view it on GitHub https://github.com/vivin/regula/issues/32#issuecomment-11746801.

vivin commented 11 years ago

Hello Arthur,

What issues were you having with unbinding? I can take a look at it and see if I can get it fixed for you! Yeah the failure in IE9 is probably because it doesn't have HTML5 validation and so it would throw an exception. Weird that it is trying to use HTML5 validation when you haven't explicitly tried to use it. That is probably a legitimate bug.

I'm glad you like Regula! Thank you for using it! :)

arthurkang commented 11 years ago

I don't remember exactly what issues I was having with the unbinding. I just remember I couldn't get it to work and simply using the 1.2.4 SNAPSHOT allowed it to work so I just went with the 1.2.4 version without giving it much thought.

Correct in that I am NOT using or attempting to use any type of HTML5 validation. I noticed two places in your code where setCustomValidity is called and I just tried and caught those two instances to get my stuff up and running without failing...

Keep up the good work!

vivin commented 11 years ago

Thank you! I'll take a look at the code some more and I'll try to figure out what's going on. Most probably, I'm calling setCustomValidity without checking to see if there are any HTML5 constraints.