W3C home > Mailing lists > Public > www-validator@w3.org > January 2011

[VE][html5] Form onsubmit Error: Invalid Return

From: Paul Spangler <pspangler3@gatech.edu>
Date: Thu, 20 Jan 2011 21:03:57 -0500
Message-ID: <4D38E98D.8060406@gatech.edu>
To: www-validator@w3.org

I couldn't find in the HTML 5 spec where it talks about the form 
element's onsubmit event, but previously the typical form validation was 
onsubmit="return validationFunction()". However, this gives a validation 

/Line 8, Column 31/: Bad value return false for attribute onsubmit on 
element form: invalid return

|	<form onsubmit="return false"*>*|

What is the correct way to cancel a form submission in HTML 5? The error 
message is not very clear in this regard considering it's valid in 
previous specs and supported in modern browsers. Full example below:

<!DOCTYPE html>
<html lang="en">
<meta charset="ISO-8859-1" />
<title>Form Validation Test</title>
<form onsubmit="return false">
<input type="submit" value="Do Not Submit Me!" />

Thank you,
Received on Saturday, 22 January 2011 07:06:43 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 November 2015 11:01:36 UTC