Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By evets33 on
Hello
I want to establish a jquery validation for my user connection login block, ie without page refresh in case of connection failure, for example.
But I do not see how to start .
Would you have an idea please ?
Thank you
Comments
You can add JS to the user
You can add JS to the user login block by implementing hook_form_user_login_block_alter():
You can then put your code in the file located at [PATH TO YOUR MODULE]/js/user_login_block.js
In that file you can add your code as follows:
You can read more about JavaScript in Drupal 7 here: https://www.drupal.org/node/756722
Thank you very much ! i will
Thank you very much ! i will practice and come back