Input Type Image Submit Form Value

Input Type image submit form value?

An input type="image" only defines that image as the submit button and not as an input that can carry over a value to the server.

How do I use an image as a submit button?

Use an image type input:

<input type="image" src="/Button1.jpg" border="0" alt="Submit" />

The full HTML:

<form id='formName' name='formName' onsubmit='redirect();return false;'>  <div class="style7">    <input type='text' id='userInput' name='userInput' value=''>    <input type="image" name="submit" src="https://jekyllcodex.org/uploads/grumpycat.jpg" border="0" alt="Submit" style="width: 50px;" />  </div></form> 

Input type image doesn't submit the form when you hit enter

Your form needs an action attribute, referring to the script which will process the results - for example:

<form id="myform" action="./myform.php">
<!-- the rest of your form -->
</form>

Without an action attribute, the form cannot be submitted as the browser doesn't know where to submit it to.

button image as form input submit button?

You could use an image submit button:

<input type="image" src="images/login.jpg" alt="Submit Form" />

HTML form not working with image submit button?

When using a input type="image", the browser sends submit_x and submit_y.

So in PHP, $_POST['submit'] will not be available, but $_POST['submit_x'] and $_POST['submit_y'] will be defined (containing the X/Y coordinates where the image was clicked on).

How can I make my input type=submit / an image?

input[type=submit] {
background: url(http://lrroberts0122.github.com/DWS/lab6/level-2/images/button.png);
border: 0;
display: block;
height: _the_image_height;
width: _the_image_width;
}

how to submit input with image type

You can try this example:

<button type="submit" name="addBal" style="padding: 0; border: none;"><img src="monkeydluffy.png" /></button>

It can serve the same purpose of submitting. As for additional information, you can check out this discussion regarding your concern.

Input Type image submit form value?



Related Topics



Leave a reply



Submit