simsalabim/sisyphus

Clear form on submit

Closed this issue · 1 comments

Hello everyone..
I don't have a proper submit button on my form cause I have to verify some fields before submit the data.. for doing that I call a function on js when you click the button, like this:

Unfortunately this is not considered from sisyphus as a submission and when I load a new form I have all the data from the previous entry.. Is there a way to modify that?
Thanks in advance
Apologize for my English

Diego

As discussed in the mail,

There is a manuallyReleaseData method for similar purposes which you can use.
Also you can redesign your solution as forms have 'onsubmit' event and you can check data for validity inside of that method execution and return from it if data is invalid.

As you see, there are several options to achieve the goal, choose whatever you like best. I would recommend not to use 'onClick's incorporated into markup but event listeners instead.