Chapter 7.4. Dashboard Controller new_project

WhatWhat uses a few common JavaScript functions in its pages, and our dashboard template imports this set of master.js functions.

The major use of JavaScript in dashboard.kid is to dynamically display the new_project form.

<a href="#" onclick="toggle('new_project'); clr('ta_new_project');fcs('tf_desc');
return false;">new project</a>

This line defines an onclick event that does three important things:

  • It toggles the visibility of the new_project element.

  • It clears the text in the new_project text area field, which contains a description of the new project.

  • It clears the desc text field, which contains the project name, and moves the focus to it so that the user can just start typing.

These things are ...

Get Rapid Web Applications with TurboGears: Using Python to Create Ajax-Powered Sites now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.