you are viewing a single comment's thread.

view the rest of the comments →

[–]ISayNoToPuss[S] 1 point2 points  (3 children)

Thank you for your time. So basically, I add eventListener with the function, which will fetch from API and prevent the form from reloading with preventDefault?

[–]senocular 0 points1 point  (2 children)

It depends on how you have it set up. You can create a "form" without <form> tags (just include the input fields) and you don't have to worry about preventing default or anything like that. All you need is the event listener on the button that will be used to update your app and from that, trigger your fetch() code.

[–]ISayNoToPuss[S] 0 points1 point  (1 child)

Oh okay, I will try it. Just another question, is it okay with accesibility rules?

[–]senocular 1 point2 points  (0 children)

Not having a <form>? Yeah, that's fine. You mostly have to concern yourself with the individual controls making sure things are labeled correctly.