On Jul 30, 1:36*pm, "Bob Barrows [MVP]" <reb01...@NOyahoo.SPAMcom>
wrote:
> paulmitchell507 wrote:
> > I have a simple SQL query that is run inside a asp page. *I would
> > normally display the results using the response.write("my name is: " &
> > name)
>
> Err ... the parentheses are not needed unless you are using javascript
>
> > if I wanted the output displayed. *On this occasion I want to
> > post the results to another .asp page. *How do I get the "name" field
> > into Request.Form("name") that I need to pass to the next .asp page?
>
> Use a hidden field:
> <form>
> ...
> <input type="hidden" name="name" value="<%=Request.Form("name")%">
> ...
> </form>
>
> Note: <%= is shorthand for <%Response.Write
>
> --
> Microsoft MVP -- ASP/ASP.NET
> Please reply to the newsgroup. The email account listed in my From
> header is my spam trap, so I don't check it very often. You will get a
> quicker response by posting to the newsgroup.
Thank you taking the time to reply to my basic question!
To explain a little further, after I run the SQL, I am left with a
single value for holiday_ID. I then call the following to pass the
holiday_ID to another asp file with our any user input
<form
method=post
action='email2.asp'
name='myform'>
<input
type=hidden
name='myname'
value="<%=Request.Form("holiday_id")%>">
</form>
<script>
window.onLoad = document.myform.submit();
</script>
I am trying to display the holiday_ID in the email2.asp page as I am
not sure that the holiday_ID is sent. I have put the following on the
email2.asp page,
<%
'declare your variables
Dim holiday_ID
'Receiving values from Form, assign the values entered to variables
holiday_ID = Request.Form("holiday_ID")
If holiday_ID <>"" Then
Response.write("No records returned.")
Else
Response.Write("my id is:" & holiday_ID)
End If
%>
If I run the app, "my id is" gets displayed but no holiday_ID. It
would appear that somthing is passed to the email2something.asp page,
but what?
I am sure it's obvious, I am not familiar with asp!
|