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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Post Question 1

Status
Not open for further replies.

BPetro

Programmer
Oct 1, 2002
59
US
I just tried moving from INPUT TYPE="Submit" to TYPE=Image for the usual reasons, but I hit a reaction in the ASP code handling the submitted page that has me stumped - does anyone have any suggestions how to handle this difference?

Both "Submit" and "Image" perform a submit just fine, but if the name and id of this field is "VolunteerButton" and the handling VB script says:
if not isempty(Request.Form("VolunteerButton")) then
Session("TableName") = "Volunteer"
end if

Well, if its a "Submit" type button - this works.
If its an "Image" type button - it evidently remains "empty" - it posted, but the button itself is no longer answering a 'value'. I have a couple submit buttons that perform a similar action but with two different tables. How do I work around this? Any ideas?

Thanks!
 
does your <INPUT TYPE=IMAGE> specify VALUE=SUBMIT

eg)
Code:
<INPUT TYPE=&quot;IMAGE&quot; NAME=&quot;VolunteerButton&quot; VALUE=&quot;SUBMIT&quot; SRC=&quot;somepicture.jpg&quot;></INPUT>
Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
No it didn't - I saw nothing about that in the doc's I read. I just tried it and - sorry - I see no change in behavior. The isempty(Request.Form(&quot;VolunteerButton&quot;)) still no longer triggers once I swap the button to an image button. Hope I'm not being dense and missing something -- can you clarify or are there other ideas?
 
When using an active image to submit your form, two(2) pieces of informaiton are sent (not just one).

If your image is named &quot;VolunteerButton&quot;, the resulting form information will have &quot;VolunteerButton.x&quot; and &quot;VolunteerButton.y&quot;, where &quot;x&quot; and &quot;y&quot; are the coordinates of the pixel the user clicked on the image (similar to a server-side image map).

Change your test to check for
Request.Form(&quot;VolunteerButton.x&quot;)
or
Request.Form(&quot;VolunteerButton.y&quot;) Hope this helps.
Ciao, K----------------
&quot;If you were supposed to understand it, we wouldn't call it code&quot; - FedEx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top