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

still having problem passing button value to asp

Status
Not open for further replies.

EdRev

Programmer
Aug 29, 2000
510
US
Thanks James, but I'm still having problem passing the value of the button to my asp. This is what I did and let me know if I'm doing it wrong.

<body onload=&quot;document.areaform.area_no.focus();&quot;>
<form name=&quot;areaform&quot; action=&quot;update.asp?action=area_info&quot; method=&quot;post&quot; onsubmit=&quot;return verifyarea()&quot;>
<center>
<h3>Update Area Information</h3>
<table>
<tr><td>Area Number<input type=&quot;text&quot; name=&quot;area_no&quot; maxlength=&quot;5&quot; size=&quot;5&quot;></td>

<tr><td align=&quot;center&quot;><input type=&quot;image&quot; src=&quot;add.gif&quot; id=&quot;area&quot; name=&quot;add_area&quot;>
<input type=&quot;image&quot; src=&quot;update.gif&quot; id=&quot;area&quot; name=&quot;update_area&quot;>
<input type=&quot;image&quot; src=&quot;delete.gif&quot; id=&quot;area&quot; name=&quot;delete_area&quot;></td>
</table>

When it gets to the update.asp, I want to find out which button was clicked, this is what I did.

<%
update_action=request.form(&quot;area&quot;)

if update_action=&quot;delete_area&quot; then
...code
else if update_action=&quot;update_area&quot; then
...code
else if update_action=&quot;add_area&quot; the
...code
end if
end if
end if

When I click any of the button, it just display a blank page.

Can anybody tell me what I'm doing wrong.

thanks,




 
Ed,

Try this:

<input type=&quot;image&quot; src=&quot;update.gif&quot; id=&quot;update_area&quot; name=&quot;update_area&quot; onclick=&quot;return document.myform.submit()&quot;>
<input type=&quot;image&quot; src=&quot;delete.gif&quot; id=&quot;delete_area&quot; name=&quot;delete_area&quot; onclick=&quot;return document.myform.submit()&quot;>

<% // x and y coordinate variables are sent when an input
// type=&quot;image&quot; is clicked resulting in the form being
// submitted
if ( !isNaN( Request.Form(&quot;update_area.x&quot;)) ){
Response.Write(&quot;Update Selected&quot;);
}else if ( !isNaN( Request.Form(&quot;delete_area.x&quot;))){
Response.Write(&quot;Delete Selected&quot;);
}
%>

Hope this helps
-pete
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top