How to disable/enable keys |
(02-11-2021, 12:23 PM)christaliise Wrote:(02-10-2021, 01:33 AM)brianjamestorr Wrote: You can use regex and disable input for those characters you don't allow. Well depends what you want to have, block user to enter character when typing or when form is submitted. With javascript you can block user enters letters in input, but this is not really secure, so you can do it in javascript and also in php just to be safe. Using regex with built in function for form validation PHP Code: $this->form_validation->set_rules('', '', 'regex_match[/a-zA-Z0-9 .@#$%&/]'); then message you will get if character is not allowed is "The {field} field is not in correct format.", but you can change that message. |
Messages In This Thread |
How to disable/enable keys - by christaliise - 02-07-2021, 05:27 AM
RE: How to disable/enable keys - by paliz - 02-07-2021, 12:14 PM
RE: How to disable/enable keys - by christaliise - 02-07-2021, 02:43 PM
RE: How to disable/enable keys - by brianjamestorr - 02-10-2021, 01:33 AM
RE: How to disable/enable keys - by christaliise - 02-11-2021, 12:23 PM
RE: How to disable/enable keys - by brianjamestorr - 02-12-2021, 08:26 AM
RE: How to disable/enable keys - by christaliise - 02-14-2021, 10:35 AM
RE: How to disable/enable keys - by christaliise - 02-18-2021, 07:15 AM
RE: How to disable/enable keys - by brianjamestorr - 02-25-2021, 08:37 AM
RE: How to disable/enable keys - by christaliise - 02-26-2021, 05:03 AM
RE: How to disable/enable keys - by christaliise - 02-27-2021, 06:13 AM
|