Jump to content

Image Submit button


Ryflex

Recommended Posts

Hi all,

 

I'm trying to make a form with several submit buttons. Instead of the boring one's I want to use small images.

After searching on google etc. I found the following

<INPUT TYPE="IMAGE" SRC="images/oce.gif" ALT="Submit" NAME="submit" ID="OCE" VALUE="OCE" WIDTH="48"; HEIGHT="48";></INPUT>

Somehow nothing hapens when I use the button. When I use a GET method it gives me in return some coordinates. I need to use the POST value but is doesn't work.

Full form:

<FORM ID="Invoer" NAME="Invoer" METHOD="post" ACTION="/index.php">
<INPUT TYPE="IMAGE" SRC="images/oce.gif" ALT="Submit" NAME="submit" ID="OCE" VALUE="OCE" WIDTH="48"; HEIGHT="48";></INPUT>
<INPUT TYPE="SUBMIT" NAME="OCEoverdracht" ID="OCEoverdracht" VALUE="OCE overdracht"></INPUT>
<BR>
<INPUT TYPE="SUBMIT" NAME="2e" ID="2e" VALUE="2e Kamer"></INPUT>
<INPUT TYPE="SUBMIT" NAME="Oldelft" ID="Oldelft" VALUE="Oldelft"></INPUT>
<INPUT TYPE="SUBMIT" NAME="Winvision" ID="Winvision" VALUE="Winvision"></INPUT>
<INPUT TYPE="SUBMIT" NAME="Cargonaut" ID="Cargonaut" VALUE="Cargonaut"></INPUT>
</FORM>

Can anyone help me.

 

Gr Ryflex

Link to comment
https://forums.phpfreaks.com/topic/248019-image-submit-button/
Share on other sites

Thanks for the quick response.

I normally used

if($_POST['OCE'])
{
header("Location: /standby/oce.php");
}

for handling but didn't know how to check with the coordinates.

How do I know which coordinates to check for because the are diferent each time.

 

Gr Ryflex

Link to comment
https://forums.phpfreaks.com/topic/248019-image-submit-button/#findComment-1273484
Share on other sites

the name of your image input is "submit" not "OCE", so you must use $_POST['submit'] not $_POST['OCE'] to check for the click event on the image..

 

you will want something like this..

 

if(isset($_POST['submit_x']) || isset($_POST['submit_x'])) {  }

Link to comment
https://forums.phpfreaks.com/topic/248019-image-submit-button/#findComment-1273486
Share on other sites

Archived

This topic is now archived and is 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.