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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.