Jump to content

Never used an image as a submit button


otuatail

Recommended Posts

Never used an image as a submit button

 

I need to use an image but as a submit so that I can access the data on the next page. Is this near right?

 

<input type="button" name="submit" src="images/Update_Drinks.gif" alt="Update_Drinks">

 

The image and path are correct.

Link to comment
Share on other sites

http://www.ampsoft.net/webdesign-l/image-button.html Go here to see the CSS you need.

 

<form action="http://www.google.com/search" method="get">
  <input type="Text" name="q" size="45">
   
  <button id="replacement-1" type="submit">Search with Google</button>
  <!-- <div><button style="display:block" id="replacement-1" type="submit">Search with Google</button></div> -->
</form>

<h4>Using padding-top for image replacement:</h4>

<form action="http://www.google.com/search" method="get">
  <input type="Text" name="q" size="45">
   
  <button id="replacement-2" type="submit">Search with Google</button>
</form>

Link to comment
Share on other sites

Since you have already been given the solution in another near-identical thread, I'll close this one.

 

For reference purposes, compliant browsers return the x y coordinates of WHERE the submit image was clicked, relative to the upper left corner.

 

For a form method POST, and a submit button named banana, $_POST['banana_x'] and $_POST['banana_y'] will contain those values. $_POST['banana'] will have no value.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.