Home Drupal Drupal 7 Module Development – JavaScript confirm before leaving page – Daily Dose of Drupal ep. 111

Drupal 7 Module Development – JavaScript confirm before leaving page – Daily Dose of Drupal ep. 111

2 min read
2
0
19



Learning module development in Drupal is not easy, but this Daily Dose of Drupal episode provides a very simple but practical module development video tutorial to use when learning about Drupal Module development. If you have a complex form on your Drupal websites, whether it is a Node creation form or perhaps even a webform, you may want to warn users before they navigate away from the page. This can help inform users that if they navigate away from the page before submitting the form, they may lose the contents of the form.

Note: In the uploaded module (available on codekarate.com using link below) I added an extra feature that makes sure the confirmation form does not show up when submitting the form. I did not cover this in the video.

In this episode you will learn:

– How to create a simple Drupal 7 module
– How to create a Drupal 7 .info file
– How to create a Drupal 7 .module file
– How to use the Drupal 7 hook_init() function
– How to use the drupal_add_js() function to add inline JavaScript
– How to use the current_path() function to get the current Drupal system path

Links:
http://codekarate.com/daily-dose-of-drupal/drupal-7-module-development-javascript-confirm-leaving-page

Thanks to Drupalize.me (http://drupalize.me) for sponsoring this episode.

Load More Related Articles
Load More By admin
Load More In Drupal

2 Comments

  1. Donny Stiefel

    October 14, 2020 at 2:33 am

    Just started building modules in Drupal and this was a great, quick tut on using a hook. Thanks!

    Reply

  2. Kyle Skrinak

    October 14, 2020 at 2:33 am

    I love the baby-steps towards writing a module. Brilliant!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Check Also

How to add Testimonial using Quix Page Builder to your Joomla website

Testimonials in a website highly important as the potential customers want to know what pe…