Reset button cannot clear fields after displaying error messages

P

PC Leung

Hello

my form extends from ValidatorForm
and making use of validator.xml and validator-rules.xml,

The reset button can clear fields within form
if the submit is not pressed.

If I pressed the submit button and
error messages display on the top of the form.
And then now I click the reset button again,
fields cannot be cleared.

Why is it so?
 
M

Murray

PC Leung said:
Hello

my form extends from ValidatorForm
and making use of validator.xml and validator-rules.xml,

The reset button can clear fields within form
if the submit is not pressed.

If I pressed the submit button and
error messages display on the top of the form.
And then now I click the reset button again,
fields cannot be cleared.

Why is it so?

That is correct behaviour for a form reset button. It isn't a *clear*
button, it's purpose is to *reset* the fields to the state they were in when
the page was loaded. Think of it more like an undo button. If you want to
clear fields, I think you'll have to write a custom javascript function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top