">'); win.document.writeln(''); win.document.writeln(''); }
 

The Indefinite Article.

Friday, February 25, 2005

Pure JavaScript Forms: Step One

One of the things I've wanted to do for some time is to get server-side scripting code out of forms. Why do this? Typically, a form will have a lot of server side logic and variable writeouts and whatnot in it. Imagine a form that you update your contact information with. The server gets your info from the database, then writes your name in the value field of the name text box. To do that, the web developer puts code that operates on the server side into the html form. This is the messy part. To do this, the developer has made something that intermingles the server-side scripting language with html. While this is relatively easy to do, it becomes less easy to maintain. It makes it more difficult to shift from one server-side language to another. It makes it harded for a web designer to control the look and feel.

For step 1, I've taken a form that has multiple contexts (New, Update, Search) and put those contexts into one pure html form. At the top of the linked page, there are three links that control the context of the form. Whenever this is actually used, the server side script would set a java variable that sets the context. In the next steps I will set variables in the forms and work on displaying errors and mandatory fields using Javascript.

0 Comments:

Post a Comment

<< Home