okay..so how can check if the string only contains numbers? im quite new to jquery..would i need to use reg ex?
On Sep 16, 3:58 pm, "Andy Matthews" <[EMAIL PROTECTED]> wrote: > Well, a number by definition can't have spaces in it. So if there ARE > spaces, then it's a string, and can be treated as such. > > Alternately I suppose you could try multiplying the value by 1 and see what > you get. > > andy > > -----Original Message----- > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On > > Behalf Of africanshox > Sent: Tuesday, September 16, 2008 9:39 AM > To: jQuery (English) > Subject: [jQuery] Checking if input is a number. > > i have a serach box that checks for a product code or product keyword. > > I need to find out how i can check if the input submitted on this search > box is a number, and if it is, remove any white spaces. > > The reason is that product codes coming from a feed have a space in them and > it is much easier if i sue jquery rather than go through a collection fo > nearly 20,000 codes. > > can anyone point me in the right direction?