[jQuery] Re: Firefox problems ( with input reg. exp. verification).

2008-11-20 Thread Jsbeginner
The length check >= 5 does not do anything rearly as with a .com you already have 4 characters so it allows b.com which is not possible. But if you change the 5 to 6 it stops two letter domains for two letter extensions. As for the 62 maximum size I've solved this problem with html setting th

[jQuery] Re: Firefox problems ( with input reg. exp. verification).

2008-11-20 Thread Rik Lomas
Hey, the problem seems to be with the {2,63} bit, so I've rewritten your code (again), it's not as strict as before but it's a lot faster now because it tests string length rather than regex lengths: $(document).ready(function(){ var reg = /^[a-z0-9]+[a-z0-9\-\.]*\.[a-z]{2,4}$/i; $('input#dom

[jQuery] Re: Firefox problems ( with input reg. exp. verification).

2008-11-20 Thread Jsbeginner
Your code is alot better than mine and the use of test instead of match is better too. However I still have the same problem, even with your code with Firefox after 16 characters even typed slowley, Firefox becomes slow and after 20-25 characters it even blocks... Is this a bug with firefox or wi

[jQuery] Re: Firefox problems ( with input reg. exp. verification).

2008-11-19 Thread Rik Lomas
I've simplified your code for you and sped up your testing by using the regular expression "test()" method $(document).ready(function(){ $('input#domain').keyup(function(){ var domain = $(this).val(); var reg = /^([a-z0-9]+(\-?\.?[a-z0-9]*)){2,63}\.([a-z]){2,4}$/i ; if (reg.test(dom