Last post Jul 09, 2013 02:10 AM by mhcodner
Jul 08, 2013 11:49 AM|wavemaster|LINK
I have two images on a page each one inside their own form, each have been defined as input type image.
If these were submit buttons I would use the action attribute to figure out which image was selected.
The action attribute is not supported.
Is there an alternavite?
Jul 08, 2013 12:22 PM|Afzaal.Ahmad.Zeeshan|LINK
What about hidden input? You can set some value for that too! And check which image was submitted!
Jul 08, 2013 12:30 PM|wavemaster|LINK
Jul 08, 2013 12:34 PM|Mikesdotnetting|LINK
You can use the name and value attributes of the input type.
<input type="image" name="action" value="image1" src="~/images/img1.png" />
<input type="image" name="action" value="image2" src="~/images/img2.png" />
If Request["action"] == "image1" the first image was clicked.
What about hidden input?
Jul 09, 2013 01:38 AM|Afzaal.Ahmad.Zeeshan|LINK
Because, hidden input can tell him, which form was submitted! He has two images on two different pages. Two different page = Two different forms. So two different hiddent input values can be the answer!
Jul 09, 2013 02:04 AM|Mikesdotnetting|LINK
Robert's marked your reply as answer and that's fine, but for future readers, hidden fields is not the recommended way to do this.
Jul 09, 2013 02:10 AM|mhcodner|LINK
I have a page on my site that has two completely sperate forms and I think the simplest way is to have them as seperate pages and call them via
Using the above as an example, the only thing is you would have to process the form input on each different page which should be fine to accomplish.