More Javascript Issues
Before I came here I tended to avoid Javascript like a sort of scourge. I found out that this was a terrible idea in some instances and Javascript can increase the usability and performance of some web-based applications enormously.
However, in the case when one is dynamically populating controls (selects, checkboxes, etc) on a form based on previous input, then persisting the state (values or actual controls on the form) of the said controls on the server, it quickly becomes an annoyance.
Example:
Based on a previous answer of a pulldown
I like:
a) Apples <--
b) Bananas
c) Peaches
A series of checkboxes appear
[ ] mcIntosh
[ ] Granny Smith
[ ] Moldy
This is quick and easy with Javascript until a user has to be able to refer back to the process and revise his or her answers. Then the server must rebuild the page in a consistent state and generate Javascript accordingly, making the proper values (and controls) available with the proper values.
Javascript is a cool tool. But I've come to the realization of a few things.
#1) NEVER use it for form validation on anything customers will be using. I knew this before I came here from nightmarish validation issues when users had Javascript turned off.
#2) DO use it in circumstances where you can guarantee users are going to turn it on -- as on our e-commerce backends. It saves an enormous amount of time.
#3) DON'T use it in complex cases where it's tied into the backend. It's more trouble than it's worth.
#4) Use Firefox to debug. IE has a universal message of "Object expected." Occasionally I feel like going postal whenever I see that message.
--Jaimie
0 COMMENTS