Support the ongoing development of Laravel.io →
Input Forms
Last updated 1 year ago.
0

Input type image is not designed to carry values to the server. The values submit_x and submit_y contain the location of your cursor from the moment you clicked the button. These values wil not be present if you submit the form using the keyboard only.

Quote from W3 specification page

Creates a graphical submit button. The value of the src attribute specifies the URI of the image that will decorate the button. For accessibility reasons, authors should provide alternate text for the image via the alt attribute.
When a pointing device is used to click on the image, the form is submitted and the click coordinates passed to the server. The x value is measured in pixels from the left of the image, and the y value in pixels from the top of the image. The submitted data includes name.x=x-value and name.y=y-value where "name" is the value of the name attribute, and x-value and y-value are the x and y coordinate values, respectively.

If the server takes different actions depending on the location clicked, users of non-graphical browsers will be disadvantaged. For this reason, authors should consider alternate approaches:

Use multiple submit buttons (each with its own image) in place of a single graphical submit button. Authors may use style sheets to control the positioning of these buttons.
Use a client-side image map together with scripting.

Read more about it here:

http://www.w3.org/TR/html401/interact/forms.html

Last updated 1 year ago.
0

Thank you. Makes sense. That's how often I use image lol.

Last updated 1 year ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

matalina matalina Joined 28 Feb 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.