Gross, but effective:
<script language="JavaScript">
<!--
function resetForm()
{
var f = document.forms[0]
for (var i=0; i<f.length; ++i) {
if (f.elements[i].type != "hidden") {
f.elements[i].value = '';
}
}
f.elements[0].focus();
}
// -->
</script>
-- Jim
Rick Reumann <[EMAIL PROTECTED]> writes:
> If the user submits a form and some server side validation is done and
> the jsp form returns to the user with some validation, what is the
> best way to allow the user to clear the form and start over. Having a
> <html:reset> button whill only clear new things they enter, and
> refreshing is currently returning the same form with the same
> validation errors. I was thinking maybe having a button labeled
> "reset" but what it actually does is submit to an action that clears
> out all the fields and then returns you? Is this a good way to do it,
> or is there a better way with struts?
>
> Thanks for any feedback.
>
>
> --
>
> Rick
> mailto:[EMAIL PROTECTED]
>
> "Why do people in ship mutinies always ask for 'better treatment'? I'd
> ask for a pinball machine, because with all that rocking back and
> forth you'd probably be able to get a lot of free games."
> -Jack Handey
>
>
> --
> To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
--
Jim Crossley
http://www.lads.com/~jim
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>