Jump to content

How to customize the validation?

validation error trapping input trapping

  • Please log in to reply
3 replies to this topic

#1 Oh.No.John!



  • Members
  • Pip
  • 5 posts

Posted 02 January 2015 - 01:39 PM

Can anyone help me in trapping the user input,

for example, in my database i have a specific row in my table and its datatype is INT and the GC provided error trapping that upon typing in the textfield, it will only accept numbers. but I've discovered, that it accept also (these specific characters #$%). Can you help me find or locate on the source code on how can i customize it? that it will only accept numbers. 

I really appreciate GroceryCrud and it was a big help on our project.

Attached Thumbnails

  • 123.png

#2 Oh.No.John!



  • Members
  • Pip
  • 5 posts

Posted 11 January 2015 - 07:34 PM

Help me in these problem please.

#3 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts
  • LocationMumbai, India

Posted 11 January 2015 - 08:26 PM

we i will recommend that you can do the same by setting the HTML 5 form field validations post the page is generated. This can be done by directly altering the properties of the fild you wish to control using javascript.


If you want to make sure that the user enters only numbers - u can use jquery masking for the same.!!!


Hope you get the solution for the same.


Happy GCing :)

#4 Dogtooth



  • Members
  • PipPip
  • 10 posts
  • LocationGermany

Posted 15 January 2015 - 02:30 PM

Or you add the CI validation.


$crud->set_rules(fieldname, prettyfieldname, 'integer');

Also tagged with one or more of these keywords: validation, error trapping, input trapping

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users