⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

How to customize the validation?



Oh.No.John!

Oh.No.John!
  • profile picture
  • Member

Posted 02 January 2015 - 13: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.


Oh.No.John!

Oh.No.John!
  • profile picture
  • Member

Posted 11 January 2015 - 19:34 PM

Help me in these problem please.


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 11 January 2015 - 20: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 :)


Dogtooth

Dogtooth
  • profile picture
  • Member

Posted 15 January 2015 - 14:30 PM

Or you add the CI validation.

 

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