Re: value attribute on image type input

On 12 May 2010, at 17:27, MEM wrote:

> In order to have the form properly processed on the server side I need
> to add the value property on my image type input field, like so:

Browsers are inconsistent about sending the value of server side image maps. Some browsers send it, some send only the x/y co-ordinates. It is a very poor idea to depend on it being sent.

> However, when I validate, I'm getting the following error message on
> the validator:
> 
> Line 152, Column 151: Attribute value not allowed on element input at
> this point.

I don't recognise this style of error message, which suggests that you are using HTML 5 mode.

From the draft HTML 5 specification:

	The element's value attribute must be omitted.

	— http://www.w3.org/TR/html5/forms.html#image-button-state

So this is not a bug. I assume the attribute was forbidden because common current browsers fail to implement it so that while it would be backwards compatible with HTML 4, it is not compatible with browsers in practice. 


> Element-specific attributes for element input:
…
>    value

If this is output from the validator, then the list of acceptable attributes is a bug, but the reporting that the value attribute is forbidden is not.

-- 
David Dorward
http://dorward.me.uk

Received on Friday, 14 May 2010 18:20:29 UTC