D
D
Dutymy2021-07-10 20:16:37
JavaScript
Dutymy, 2021-07-10 20:16:37

How to submit a form without validation?

hello i have a form

<form action=""  id="f">
  <input type="text" required>
  <button type="submit">send</button>
</form>

The problem is that the ability to submit a form without validation is only needed in a special case. By default, the form should be checked for completeness ... That is, provide the opportunity (send anyway)

Answer the question

In order to leave comments, you need to log in

5 answer(s)
A
Alex, 2021-07-10
@Dutymy

Add the novalidate attribute to the form.
https://developer.mozilla.org/ru/docs/Web/HTML/Ele...

N
Nadim Zakirov, 2021-07-10
@zkrvndm

Use the confirm function to ask the user something like this:
The form was filled out incorrectly, are you sure you want to submit the data as is?
OK | Cancel

S
Sergey, 2021-07-10
@UDAV99

remove the required parameter

S
Sergey delphinpro, 2021-07-10
@delphinpro

Obviously, remove the required attribute

T
ThunderCat, 2021-07-10
@ThunderCat

There are no "special cases" in programming, there are conditions. catch form submit events, check conditions, and then either submit the form or not.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question