为了避免验证,请使用HTML5中的formnovalidate属性。在示例中,禁用第二个按钮的验证-
<!DOCTYPE html> <html> <head> <title>HTML formnovalidate attribute</title> </head> <body> <form action = "new.php" method = "get"> Rank <input type = "number" name = "rank" required><br> <input type = "submit" value = "Submit"><br> <input type = "submit" formnovalidate = "formnovalidate" value = "Submit with no validation"> </form> </body> </html>