Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Feedback on: Multi-dialogue forms on one page

irt.org | About | Feedback | 1840 [ previous next ]

Feedback on:
Multi-dialogue forms on one page

Sent by
Rob Stewart on October 09, 2000 at 16:56:38:

Worth:
Very worth reading

Comments:
This article discusses a useful technique. However, I find it falls short in several regards.

First, the code fails to cache properties and instead repeats lookups. For example, within the show() function, the expression, document.hiddenForm, appears repeatedly. Accessing the document object itself can be expensive. Accessing a property on the same object repeatedly is a waste of time. Instead, a local variable, perhaps hiddenForm should be assigned that property (var hiddenForm = document.hiddenForm;), then reused everywhere else. (A similar issue arises near the bottom of the same function in accessing document.layers['myTab'].document. Whew!)

Second, the show() function puts the HTML for all the tabs into a single function. The code will be easier to maintain if show() calls showTab1(), showTab2(), etc. Those functions can return an HTML string that show() can use for the rest of its work.

Third, this technique is not truly reusable. It is reusable, in the sense that you can copy and paste the code, then change the HTML, etc., to create a new form. However, it is not truly reusable because there is no framework that can be parameterized with the custom form content.

I haven't created a better version at this time, and I don't know that I'd be able to share it if I did, but I'm certain a reusable framework is possible.


Other feedback on 'Multi-dialogue forms on one page' - show all


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 21st December 2007. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.