Jump to content

[SOLVED] image buttons


Rebelrebellious

Recommended Posts

I am getting strange results using


<input type="image" name="page" value="'.$pagetype.'" alt="'.$pagetype.'" />

 

Rather than getting a $_POST['page'] variable I am getting these _POST values:

page_x = 40

page_y = 4

 

Can someone straighten me out or point me to some good reading so that I know how to use this better?

Link to comment
Share on other sites

I was hoping to use these buttons for navigation. Different buttons cause different data to load on the page. If I use a hidden value then I will need to make a seperate form for each button or I will need to consider another option. Can anyone suggest a more streamlined alternative?

Link to comment
Share on other sites

By the way. In case anyone is wondering, I added an image source and the post name / value were still not returned. I also removed the multiple inputs with the same name and tried it just on a hunch that that may have been the problem. No change. So input type=image is really just for image maps as far as I can tell.

Link to comment
Share on other sites

I am getting strange results using


<input type="image" name="page" value="'.$pagetype.'" alt="'.$pagetype.'" />

 

Rather than getting a $_POST['page'] variable I am getting these _POST values:

page_x = 40

page_y = 4

 

Can someone straighten me out or point me to some good reading so that I know how to use this better?

 

That's exactly how an 'image submit' is supposed to work. It's the same as image maps where you NEED to know the point that was clicked. For reference, the x and y coordinates are the pixel values of the point clicked measured form the top left corner of the image.

 

The 'use this better' has zero application with a form submit image since wherever you click it the form submits. The 'use this better' is the entire application if you have an image map.  Does that help?

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.