[jQuery] Re: Blank input value testing

2008-12-21 Thread Kean
My version plays nice if you have other libraries that take up the $ namespace (ie, prototype framework) On Dec 21, 7:50 am, "Lay András" wrote: > Hello! > > > > On Sun, Dec 21, 2008 at 3:09 PM, Kean wrote: > > Well blank() was not created in jQuery. > > > You can create a new function for jQue

[jQuery] Re: Blank input value testing

2008-12-21 Thread Lay András
Hello! On Sun, Dec 21, 2008 at 3:09 PM, Kean wrote: > Well blank() was not created in jQuery. > > You can create a new function for jQuery like this. > > (function($){ > $.fn.blank = function(){ >return $.trim(this[0]).length == 0; > } > })(jQuery) > > > > > $('#one').blank(); // return

[jQuery] Re: Blank input value testing

2008-12-21 Thread Kean
Well blank() was not created in jQuery. You can create a new function for jQuery like this. (function($){ $.fn.blank = function(){ return $.trim(this[0]).length == 0; } })(jQuery) $('#one').blank(); // return false $('#two').blank(); // return true haven't tested the code but should