On Mar 10, 10:38 am, Brad <[email protected]> wrote:
> When a page first displays I would like to save a bunch of data about
> a form. For example the IDs of all of the inputs and how they are
> originally defined. Depending on user actions I may need to restore
> individual form fields to their original state.
You don't need a global container to store this, as form inputs
already keep their default state as properties of the object itself.
For example,
function resetInput(obj) {
if (obj.type=="text") {
obj.value=obj.defaultValue;
}
else if (obj.type=="checkbox") {
obj.checked = obj.defaultChecked;
}
...
}
Matt Kruse