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!

request("btnName") not set?

Status
Not open for further replies.

smsinger3

Programmer
Oct 5, 2000
192
US
Hello all. For some reason, I can't see the value of request("btnName") in my asp script when I click the button and the page submits to itself. I'm sure I'm doing something really stupid. Any ideas?

Here's my html:

<%
Response.Write &quot;btnName= &quot; & Request(&quot;btnName&quot;)
%>
<html>
<script language=&quot;JavaScript1.2&quot;>
function fExport(f)
{
....form validation stuff....
f.submit()
}
</script>
<head>
<form ACTION=&quot;SubmitToMyself.asp&quot; name=&quot;frmSubmitToMyself&quot;>
<input type=&quot;button&quot; value=&quot;Export&quot; name=&quot;btnName&quot; id=&quot;btnExport&quot; onClick=&quot;fExport(this.form)&quot;>
.
.
.
</head>
</html>


Thanks for your help in advance,

Steve S.
sms@hmbnet.com

 
Inside the <form> tag you must specify if you are going to use the post method or the get method.

ex -

<form name=&quot;someform&quot; action=&quot;thispage.asp&quot; method=&quot;post&quot;>
</form>

If you use the post method then the value will be in the forms collection and you wil have to do a request.form(&quot;controlname&quot;) for the value.

If you use the get method then the value will be in the url and you will have to do a request.querystring(&quot;controlname&quot;) for the value.

Hope this helps..

frandazzo
 
Thanks for answering that. I should have caught that right away. This simple page seems to be the page from h!@#.

But something else strange is happening which doesn't make sense to me. When I use Netscape 4.7, it works fine, but when I use Netscape 6.0, it still doesn't work. This doesn't make sense since asp is not dependant on the browser?

Can anyone clue me in on my thinking?

Thanks again!

Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top