Book Image

Moodle JavaScript Cookbook

Book Image

Moodle JavaScript Cookbook

Overview of this book

Moodle is the best e-learning solution on the block and is revolutionizing courses on the Web. Using JavaScript in Moodle is very useful to administrators and dynamic developers as it uses built-in libraries to provide the modern and dynamic experience that is expected by web users today.The Moodle JavaScript Cookbook will take you through the basics of combining Moodle with JavaScript and its various libraries and explain how JavaScript can be used along with Moodle. It will explain how to integrate Yahoo! User Interface Library (YUI) with Moodle. YUI will be the main focus of the book, and is the key to implementing modern, dynamic feature-rich interfaces to help your users get a more satisfying and productive Moodle experience. It will enable you to add effects, make forms more responsive, use AJAX and animation, all to create a richer user experience. You will be able to work through a range of YUI features, such as pulling in and displaying information from other websites, enhancing existing UI elements to make users' lives easier, and even how to add animation to your pages for a nice finishing touch.
Table of Contents (15 chapters)
Moodle JavaScript Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface

Introduction


We often need to collect information from a user for a variety of reasons. For example, we get contact details or information about a problem they are having with our website. As is often the case, the most common solution to this problem is the use of a model from the real world: a form.

A basic web form is very similar to its paper-based counterpart, presenting a series of elements on the page where the user can enter the required information.

Web forms differ in that they give us the opportunity to ensure the quality of the information provided as it is entered. This process is known as form validation. Using this technique, we can apply a range of checks and constraints on the information entered. We can also ensure that all of these are satisfied before allowing the user to submit the completed form.

Moodle provides a feature-rich web forms utility based on the PHP Extension and Application Repository (PEAR) library, QuickForm. Forms produced in Moodle not using this library...