Friday, March 19, 2004

Web Site Updates

I finished the Atlas Survey page. I've used a lot of the newer techniques on this page, but I think I can further refine the way I do things. Some of the new stuff I've used:
- HTML Form elements: label to give some elements a label, fieldset to group related questions together
- Updated ASP/javascript: there are problems with IE, radio buttons, and my JS validator. I've modified the JS to count the number of items to be validated and increment another counter upon actual validation. If the two counts do not match then the form is marked as not validated and the ASP validator takes over. I've also set it up to use the custom error-handler (A number of scripts had to be modified to account for some of the changes I've made).

Some ideas for further enhancement: With a form this complex a lot of manual work has to go into setting up variable capturing and database updates. I think it's time to look into modifying things so that more automation is present. I'll have to investigate the options, but a I've considered variable naming schemes and a database variable table along with the question/answer table and the user response table.

There have also been various other updates: Atlas workshops, What's New, etc.

Instructional Components Prototype

Haven't really done much with this lately. FM decided to modify the way the demo works even though I told him I don't think the problem he's trying to fix is critical. Helped them debug by pointing out an error in the stylesheet.

CCMS Web Site

Been working full steam on the redesign this week. Encountering many bugs between the various browsers but I think I'm finally getting there. Hopefully I'll have this done next week. A quick overview of some of the bugs I've found:
  • Safari: cookies generated by javascript from a local file do not appear to be saved. Luckily this isn't a problem for CCMS.
  • IE Mac: (a reminder) @media print css selector not supported; does not support onbeforeprint javascript event ala IE Win. This one was bypassed by using an inline style that imports a print-only stylesheet using @import … print
  • IE Win: despite the existence of multiple style declarations (link, "style" and "alternate style") IE attempts to use the default style. If this style is disabled (such as when it is by the style-sheet switcher) then IE ignores all other stylesheets and uses only inline styles. I was able to get around this problem by using an onbefore print and onafterprint event handler to switch the style to the default then back to the user's preferred.
  • Getting closer on being able to finalize the design.

Tuesday, March 16, 2004

Scripting

While working on the Atlas survey form I noticed that Internet Explorer has problems with the validation of radio elements. This is probably true of checkboxes, but I haven't taken the time to investigate the extent of the problem. I've made a note to correct this.

In the meantime I've worked out a kludge.

In the ASP or HTML file where the form is located:
The number of fields to be validated is counted when the form is set up and placed in the intFormFieldCount variable. Basically the count goes like this: one for each text, textarea, file, password, select-one, and select-multiple elements; the length of the array for radio and checkbox elements.

In the validate.js file:
The script was already set up to count the number of elements that have been validated and place that number in the intValidated variable. The count will show up the same as the above because I parse through the form using the elements array instead of each validation element name. I've added some code that allows IE to skip the validation of radio form elements. After all the elements have been tested the file compares the intValidated variablee with the intFormFieldCount variable and if the former is less then the hidden form element intValidated is not set to true.

Basically what this boils down to is that if any radio form elements are to be validated then the count for IE will be less than the total and the form will be submitted as not validated, allowing the ASP companion script will take over validation chores.