Re: [webmin-devel] Input validation
Danny Sauer <[email protected]> Fri, 12 Apr 2013 16:17:13 -0500
| Newsgroups | gmane.comp.web.webmin.devel |
|---|---|
| Message-ID | <[email protected]> |
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 If you do an <input type=number>, most newer browsers will restrict values to numeric, mobile browsers will pop up a numeric keypad, and old browsers will just do a normal text field because they don't recognize that type (and the default is plain text). You can't rely on that (always verify on the server side), and the ui_lib doesn't create these for you, but giving some feedback on the client side this way is almost free, so it's basically win-win. :) Jamie Cameron <[email protected]> wrote: > > Usually I would do this on the server side, with code like : > if ($in{'fieldname'} !~ /[0-9]/) { > error("You must enter a digit"); > } > > On 12/Apr/2013 06:02 Emma wasanzy <[email protected]> wrote .. > > Hello, > Please how can I force a user to input a digit in a textbox? Or how to > validate the input to make sure is a digit? > Cheers! > > >------------------------------------------------------------------------ > >------------------------------------------------------------------------------ >Precog is a next-generation analytics platform capable of advanced >analytics on semi-structured data. The platform includes APIs for >building >apps and a phenomenal toolset for data science. Developers can use >our toolset for easy data analysis & visualization. Get a free account! >http://www2.precog.com/precogplatform/slashdotnewsletter > >------------------------------------------------------------------------ > >- >Forwarded by the Webmin development list at [email protected] >To remove yourself from this list, go to >http://lists.sourceforge.net/lists/listinfo/webadmin-devel - -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. -----BEGIN PGP SIGNATURE----- Version: APG v1.0.8 iGoEAREIACoFAlFoedkjHERhbm55IFNhdWVyIDxkYW5ueUBkYW5ueXNhdWVyLmNv bT4ACgkQvtwZjjd2PN+qNQCeOhLlAopjjQNs55wrjLsl5JjaBEwAn36YW2iDFnEC aep9QjSMFdgx0EZN =439C -----END PGP SIGNATURE----- ------------------------------------------------------------------------------ Precog is a next-generation analytics platform capable of advanced analytics on semi-structured data. The platform includes APIs for building apps and a phenomenal toolset for data science. Developers can use our toolset for easy data analysis & visualization. Get a free account! http://www2.precog.com/precogplatform/slashdotnewsletter - Forwarded by the Webmin development list at [email protected] To remove yourself from this list, go to http://lists.sourceforge.net/lists/listinfo/webadmin-devel