Submit form with <input type = 'image'> no longer working in Chrome

Viewed 1632

The image button:

<form name='form1' method='post' target='new'>
    <input type='image' src='dismiss.png' name='inputname' value='inputvalue'/>
</form>

In Chrome 69.0.3497.100, var_dump($_POST) looks like this:

array(2) { ["dismiss_x"]=> string(1) "5" ["dismiss_y"]=> string(1) "2" }

In FF and Safari, it looks like this (correct with name and value):

array(3) { ["dismiss_x"]=> string(1) "5" ["dismiss_y"]=> string(1) "9" ["inputname"]=> string(10) "inputvalue" } dis

Chrome seems to be sending only the coordinates of the click, not the actual input name or value.

This worked fine in Chrome last week.

Changing input type to "submit" works fine in Chrome as well.

1 Answers

Chrome spec compliance apparently has changed:

https://www.chromestatus.com/feature/5672688152477696

This accomplishes the exact same thing, and works on all browsers:

<form name='form1' method='post' target='new'>
    <button type='submit' name='inputname' value='inputvalue' style='background:none;border:none;padding:0'><img src='dismiss.png'></button>
</form>
Related