Regula Looks Good!!! How about rendering of validation messages.

36 views
Skip to first unread message

Raja Malik

unread,
Aug 21, 2013, 3:58:48 PM8/21/13
to regula-v...@googlegroups.com
Hello All,

Today while going through the searches for some good and easy validation frameworks for my product. I came across REGULA. I feel it is really easy to pick and implement.

May I know how does it perform when compared to HTML5 native constraint validations and Jquery validation framework. I mean the speed. I certainly believe, HTML5 native validations will be fastest just because they are native.

Also, when looking at the code samples, I see that after validation is complete it returns the array of validation messages if any. My questions is - does these returned objects controll the rendering part of validation messages. If not then I would like to work on this.

My idea is  - before applying the validation, we can configure the rendering part of the validaiton message like: 
  1. Bubble: Do they want in bubble 
  2. Text: plain red text above or below control
  3. Placeholder: Or we want the error text as a placeholder. In this case we need to change the style of placeholder.
  4. Custom: Users will handle rendering part.
Once configured regula would handle the rendering part also. No extra code needed to be written in HTML.

Please share your thoughts on this.

Thanks
Raja

Vivin Suresh Paliath

unread,
Aug 27, 2013, 12:46:55 PM8/27/13
to Raja Malik, regula-v...@googlegroups.com
Hello Raja,

Sorry that I took so long to reply. I only got this message now (I think I have the mailing list set to notify me weekly instead of daily). 

Regarding your questions:

Regula does not emulate HTML5 native-constraint validations. However, if you use HTML5 constraints (which version 1.3 will have; it will be released shortly. I am working on the docs now) it will use the native validators if they are available. Otherwise, you will need to provide a shim. As far as comparisons against jQuery Validation, I haven't really performed any benchmarks, so I am not sure.

Regarding your second question, the constraint violations do not perform any sort of rendering. This is by design since I did not want to have error-message rendering tightly coupled with Regula and I wanted to concentrate much more on the validation aspect rather than rendering. With this in mind, I would rather that rendering code did not exist inside the Regula code-base since I would like Regula to focus on validation rather than rendering.

However, that is not to say that you cannot create a renderer (perhaps as a separate project) that looks at Regula's constraint violations and renders those messages. You can simply pass the results of validation to your renderer and it will take care of the rest.

Hope this helps!


--
You received this message because you are subscribed to the Google Groups "Regula" group.
To unsubscribe from this group and stop receiving emails from it, send an email to regula-validat...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Ruin untold;
And thine own sadness,
Sing in the grass,
When eve has forgot, that no more hear common things that gleam and pass;
But seek alone to lip, sad Rose of love and ruin untold;
And thine own mother
Can know it as I know
More than another
What makes your own sadness,
Set in her eyes.

$s="01:11:02:11:01:11:02:13:01:11:01:11:01:13:02:12:01:13:01:11:
04:11:06:12:04:11:01:12:01:13:02:12:01:14:01:13:01:11:03:12:
01:11:04:12:02:11:01:11:01:13:02:11:03:11:06:11:01:11:05:12:
02:11:01:11:01:13:02:11:02:12:01:12:04:11:06:12:01:11:04:12:
04:11:01:12:03:12:01:12:01:11:01:12:01:12:02:11:01:11:01:13:
02:11:01:02:11:01:12:02";
@a=split(/:/,$s);$j="";foreach$c(@a) {@n=split(//,$c);$j.=$n[0]x$n[1];}
for($i=0;$i<$j=~y///c;$i+=8){print chr(unpack("N",pack("B32",substr("0"x32 .substr($j,$i,8),-32))));}
Reply all
Reply to author
Forward
0 new messages