Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using an image as a search button

Status
Not open for further replies.

rogerzebra

Technical User
May 19, 2004
216
SE
Hi fellas,
I have encounter a slight problem with a search button. I'm using an image as input type which it doesn't like.
I'm using the same code for submit queries and that works fine its just when I'm executing a search it doesn't take it. This should be an easy issue to solve but, after twisting it back and forth I still can't get this thing to work. So, if anyone else can point out what's wrong with this I would appreciate it. Here is my code
Code:
<input name="imageField1" type="image" src="images/submit_button3.jpg" width="92" height="24" border="0">
Thanks in advance /rz
 
Description of your problem is very vague. "it doesn't like", "it doesn't take" and "can't get this thing to work" tell us nothing about what is not working. So, once again, what is not working?

Here's my prediction from knowing absolutely nothing about your problem. You're checking for the button pressed on the next page and when image is pressed you don't trap that. That is because image as a submit sends different values than regular submit button. However, you can be experiencing a myriad of different problems. If you don't tell us what exactly they are, all we can do is guess like this.
 
*********SOLVED*************

hi Vragabond, yes that was a vague description, I'm sorry to tired, thanks for helping out though I really appreciate it. My original problem was to use an image as a submit button on my formpage, to search for a document in my database.
I was able to solve this on my own though. The issue was not html related, which I thought. I just added a slight change to my php code. I know now that this post should probably be in the php forum but, you really think that this is an html issue. So I'll post the solution here and feel free to redirect the post to the php forum.

All you have to is to add the underscore and x in your $submit variable...like so for your search


if ($_POST['submit_x'])
{

}

That's it...have a good one ;)
 
There are two variables being sent as part of the submit. In your case y ou can access them like this:
Code:
$_POST['submit_x'] /* the x co-ordinates of the mouse click on the button
$_POST['submit_y'] /* the y co-ordinates of the mouse click on the button
Just so you know [smile]

Cheers,
Jeff

[tt]Jeff's Page [/tt][tt]@[/tt][tt] Code Couch
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top