I have <button onclick="doSomething();">Do something</button> inside form_for helper. Сlicking on it causes form submission. Instead I want only to do something client-side work for what it is intended.
How can I achieve it?
EDIT: I can use only <button> tag for my purposes and it’ll be rather well if I could place it inside form.
It’s pretty easy: just add
waterreturn false;. See example:I need weekend rest and 5 minutes googling after 🙂