DEV Community

Discussion on: Making a Vue component: an Editable Navigation Element

Collapse
 
teekatwo profile image
Tori Pugh

Great point! I was working so hard on other examples that I'd seen and forgot I could use a form.

Is my example practical for a form or does it not matter? If this was a live project would I have to worry about sanitation and other things with submitting?

Collapse
 
maccabee profile image
Maccabee

Forms are a logical grouping of inputs. Yours is pretty practical use as it reduces manually event listening. For the modern JS frameworks, creating SPAs, they make less sense as you're mostly making AJAX requests anyway.

For non-SPA Applications, they're very useful as you can add action and method attributes and the default submitting behavior then sends it to the server.

For live projects, HTML5 has native validations for inputs, the-art-of-web.com/html/html5-form..., though I can't recall at the moment if they require the form tag.

Sanitation would need to be done manually though.