Simple submit/imagefield question

Sainkho
Sainkho used Ask the Experts™
on
Learning from my books and all the sample scripts use a submit button and on posting check for the $submit variable.

Fine and dandy.

But what happens when you use an imagefield instead of an HTML button. What variable should I be looking for?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®

Commented:
When you use an image for a submit button, you can still give element a name:

<form method="POST" action="--WEBBOT-SELF--">
<input border="0"
 src="Search_button.GIF" name="MySubmit"
 width="70" height="19" type="image">
<input type="text" name="txtName"
 size="20"><</p>
</form>


Here, the name is "MySubmit", although I don't know why you would want to know.

Perhaps more useful, is to add a hidden element:
<input type="hidden" name="MyForm" value="SearchForm">

Then in your ASP, you can identify which form was submitted by testing the "MyForm" element:

SELECT Request.form("MyForm")
   CASE "SearchForm"
     .... you code here
   CASE "SomeOtherForm"
     ... different code here
   CASE ELSE
    ... probably an error
END SELECT

Does this answer your question?

Best Regards,
Jim
Commented:
This question has already been answered at http://www.experts-exchange.com/Web/Web_Languages/Q_20405243.html

Commented:
When an image is used for a submit button you get back two variables called image.x and image.y where image is the name given in the name attribute. The content of these variables is the x and y pixel coordinates of the point within the image that the mouse was clicked on.

One possible use for this is that you can create an image that contains multiple clickerable areas and process differently dependent on where the image was clicked. In a way a bit like an image map.

HTH
Steve
Top Expert 2013

Commented:
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.
<note>
   In the absence of responses, I may recommend DELETE unless it is clear
   to me that it has value as a PAQ.  Silence = you don't care
</note>

Cd&

Author

Commented:
Sorry I seemed to have abandoned this one. Dodgy memory. Thanks to all for their input.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial