Month: March 2007

A cross-browser keypress detection javascript

We have learning modules that have a lot of pages, and it occurred to me it would be easier on people’s hands if they could simply use the right and left arrow keys to navigate through the module.

After a day of great frustration, I realized that it’s nearly hopeless. Not only do all the browsers report different keycodes for the right and left arrow keys, but Firefox and Safari report both of them as “0” which makes it impossible to distinguish between them.

keys.jpg

Continue reading

Create a search form or quick report in asp

The example code below shows how to set up a form using Dreamweaver and ASP that queries a database based on the value of one or more form fields.

We have a database containing the transcripts of the results of courses taken in our online learning management system. Each online SCORM course has several sections or lessons. This form checks the status and score on each individual lesson, given the user’s id and the course code.

The tables and fields involved are:

Continue reading

dotProject Recipe: add a “Complete this task” checkbox to todo list

completionCheckbox.jpg

To allow one-click completion of a task, we added a checkbox to each row of the task “to-do” lists in dotProject.

Usually I try to borrow functions from other places in the application and adapt them to the new location. In this case the completion function was borrowed from the “progress” drop-down menu, on the add-edit Task screen.

The check box submits the same values as if 100% were selected from the drop-down menu.

Continue reading

Implementing search using indexing services and asp

I wanted to add a search function to the learning modules housed in our learning management system. These modules are of several types, most are HTML/javascript-based modules, but there are also flash, pdf, and MS producer ones as well. Many of them are meant to be viewed while under SCORM control, so it is important that the search feature not interfere with SCORM communication by allowing the user to navigating away from the current module or by removing the surrounding frameset.

When under SCORM control, the script must be able to detect which module is current, and search only within that directory. When not under SCORM control, the user can have the option of searching all content on the server.

It is also important to be able to hold obsolete or private items out of the search.

Continue reading

Explanation of relative, absolute, network and web paths

Paths can be one of the most confusing aspects of web development. Most web designers are familar with absolute paths and relative paths:

Absolute paths point to files that can be anywhere on the internet. They don’t assume any relative location to the current document. An absolute path to a file will always be the same, no matter where the link to it is located.

Example of an absolute path:

http://yourdomain.com/directoryname/otherfile.htm

Continue reading