Hi,
how can I set focus on the first element of the form when adding a new record? (in datatables theme).
Thanks!
⚠ 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. ⚠
Posted 23 June 2013 - 03:08 AM
Hi,
how can I set focus on the first element of the form when adding a new record? (in datatables theme).
Thanks!
Posted 23 June 2013 - 05:01 AM
For this you will need to use jQuery and go under assets/grocery_crud/themes/datatables/js open datatables.js and there add the proper jquery code.
Somewhere under line 16 on the $(document).ready(function() {
Posted 23 June 2013 - 19:26 PM
Thanks for your answer! What I really did was to edit under
assets/grocery_crud/themes/datatables/js
the files
datatables-edit.js
datatables-add.js
and add this line somewhere after "$(function(){"....
$("#crudForm input:text").first().focus();
Works perfect ;)