Using jQuery to prevent form submission when input fields are empty

后端 未结 5 825
没有蜡笔的小新
没有蜡笔的小新 2020-12-14 08:38

The solution should be pretty straightforward. I\'m trying to prevent the form from submitting properly when no value is found within the input boxes. Here\'s my JSFiddle: h

5条回答
  •  感情败类
    2020-12-14 09:37

    HTML5: use required in input tag

    • A boolean attribute.

    • Input field must be filled out before submitting the form.

    • Works with text, search, url, tel, email, password, date pickers, number, checkbox, radio, and file.

      
      

    w3schools hint

提交回复
热议问题