request problems (again)

Results 1 to 2 of 2

Thread: request problems (again)

  1. #1
    Join Date
    Dec 1969

    Default request problems (again)

    I am still having trouble getting which image field the user clicked on. Here is my updated code. There are 3 images in a table all 3 are image fields named imageField, imageField1, imageField2. I am trying to determine which one the user clicked on. What am i missing?<BR>page1<BR>&#060;form name="form1" method="post" action="page2.asp"&#062;<BR>&#060;input type="image" border="0" name="imageField" src="snapshot1.jpg" width="130" height="130" value="a"&#062;<BR>page2<BR>&#060;% if(Request("imageField")=a)Then<BR> response.write("you did it")<BR> else<BR> response.write("try again")<BR> End if %&#062;

  2. #2
    Joseph Price Guest

    Default RE: request problems (again)

    Hi There-<BR><BR>I did a test with your above scenario. I used the following code to write out the request.form properties:<BR>&#060;%= request.form %&#062;<BR><BR>To my surprise, on the x and y coordinates of the click on the image is passed.:<BR>imageField3.x=80&imageField3.y=127<BR> <BR>One solution to your problem is just to name the three submit buttons differently, and then use this code:<BR>&#060;%<BR>if Request.Form.Item("imageField3.x") &#060;&#062; "" then<BR>Response.Write "you won"<BR>elseif Request.Form.Item("imageField2.x") &#060;&#062; "" <BR>response.write "you lost"<BR>end if<BR><BR>Hope this helps!<BR><BR>- Joe Price<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts