I had this issue too.
form.reset() resets fields in the form back to their original state when the
page loaded. Chances are the form's original state was populated. You may
want your reset button to call a method that sets all your fields to blank
instead of using form.reset()
-Original
Victor.T. Ying wrote:
Hi,
I meet a problem using structs validator and reset button
The problem occurs when the validator find a validation error, then
reset button can not clear the input field but retain the error values.
BTW the respective form is in the session and I am using html:reset
Instead of a reset you could use a simple button and the related onClick
event to call a javascript that sets all field to .
What do you think about this workaround?
Take note that it isn't an expected behaviour for a reset button. I suggest
you to name such a button with a value different from
-Original Message-
From: aris [mailto:[EMAIL PROTECTED]
Instead of a reset you could use a simple button and the
related onClick
event to call a javascript that sets all field to .
What do you think about this workaround?
Take note that it isn't an expected behaviour for a
I'm not sure how tricky it is in JavaScript...
function doit(obj) {
obj = obj.form;
i = 0;
while (obj.elements[i] != null) {
if (obj.elements[i].type.toLowerCase() != button) {
obj.elements[i].value = ;
}
i++;
}
}
Attach this to the onClick event of a button in the form
5 matches
Mail list logo