I think it should be replace(/[^ \.0-9]/g,'')
not sure bout JS regex but in python . matches any character On Dec 6, 10:46 am, Anthony Bastardi <[email protected]> wrote: > How about: > > replace(/[^ .0-9]/g,'') > > > > > > > > On Tue, Dec 6, 2011 at 11:36 AM, Vineet <[email protected]> wrote: > > But it doesn't accept decimal point either. > > How to make it accept the decimal point? > > > --- Vineet > > > On Dec 6, 10:25 am, Saurabh S <[email protected]> wrote: > > > Thanks Massimo :) > > > > On Dec 6, 9:18 am, Massimo Di Pierro <[email protected]> > > > wrote: > > > > > <script>jQuery('#tablename_fieldname').keyup(function() > > > > {this.value=this.value.replace(/[^ 0-9]/g,'');});</script> > > > > > On Dec 5, 9:46 pm, Saurabh S <[email protected]> wrote: > > > > > > Hi i have used custom form in my application > > > > > > example: > > > > > > <tr> > > > > > <td> {{=form.custom.label.mobile}}:</td> > > > > > <td>{{=form.custom.widget.mobile}}</td> > > > > > <td>{{=form.custom.label.email}}:</td> > > > > > <td>{{=form.custom.widget.email}}</td> > > > > > </tr> > > > > > > I need a javascript/jqeury function to allow spaces and numbers only > > > > > in the mobile field, even if user tries to enter some character or > > > > > special character or anything else other than spaces and number , it > > > > > should not allow the user to write it there. > > > > > > Please suggest..

