Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does form still submit when you have javascript disabled?

It appears that a form will still submit even when you have javascript completely disabled. I thought that it takes javascript for it to work... the onClick() or onSubmit() function fires which triggers the GET/POST request.

like image 642
laggingreflex Avatar asked Jan 21 '26 15:01

laggingreflex


2 Answers

That's correct. That means your browser manually sends the GET/POST request (without the event listeners firing). A lot of websites still have submit buttons for this very reason (i.e. a fallback).

You could remove the submit button, if you don't want users submitting the form.

like image 155
Aeveus Avatar answered Jan 24 '26 04:01

Aeveus


No , the submit action is triggered by <input type="submit"> (Actually a button) Which is html processing command. Additionally you can submit the form by using button input type but rased a javascript function to submit a form. In the second case if the javascript is disabled , it isn't going to submit the form for you.

Lastly: onclick,onfocus,onblur etc. events and anything inside are javascript. Mostly Other than that is not associate with javascript.

Hope you underatands

like image 24
Poomrokc The 3years Avatar answered Jan 24 '26 04:01

Poomrokc The 3years