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

javascript and asp

Status
Not open for further replies.

wazilian1

Programmer
Nov 8, 2002
38
US
I have a simple asp file I'm working with that all I want to do is display input from a form on a different page. The page with the form has the text box/area input and a button. Right now I have the button calling a javascript function which will prompt the user with a confirm box then call the .asp file. But when the asp file appears on the screen, the data is not there. I'm outta ideas. Any help would be appreciated. Thanks in advance. Below is my .asp file code.

<%@ language=&quot;javascript&quot; %>
<html>
<body>
Data from test page
<br />
<%
Response.Write(Request.Form(&quot;date&quot; + &quot;!<br />&quot;));
Response.Write(Request.Form(&quot;contact&quot;));
%>
</body>
</html> wazilian
King of Wazil
 
Make sure that your form method is POST (since you are using the request.form object). -- Just trying to help... LOL [ponder]
 
yep, the method is post. i want to use post cause there may be a lot of data getting passed along and i don't want it showingin the url either. but thanks for the reminder mwolf00. wazilian
King of Wazil
 
oh, btw, still have the same problem, hehe. wazilian
King of Wazil
 
try this
<%
Response.Write(Request.Form(&quot;date&quot;) + &quot;!<br />&quot;));
Response.Write(Request.Form(&quot;contact&quot;));
%>
I do not believe oyu can manipulate the requet the way you were.

A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
sorry, one to many ) in the first request
corrected
Response.Write(Request.Form(&quot;date&quot;) + &quot;!<br />&quot;); A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
hhhhmmm....
says 'undefined' when the .asp file appears. interesting.
thanks though onpnt. wazilian
King of Wazil
 
jsut for kicks and to see if it is a simple formatting issue try this out
<%@= language=&quot;vbscript&quot; %>
<html>
<body>
Data from test page
<br>
<%
Response.Write Request.Form(&quot;date&quot;)
Response.Write Request.Form(&quot;contact&quot;)
%>
</body>
</html>

obviously this is vbscript. as you recieved a undefined error though its leading that the form values are not there. this will work if they were passed correctly. good test A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
that's <%@ LANGUAGE=&quot;VBScript&quot; %> not <%@= LANGUAGE=&quot;VBScript&quot; %>
even so this is not needed as the default is vbs A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
well, i tried the vbscript, and still nothing. gonna take a better look at the html and javascript in the html page. and just when i thought i was getting the hang of this stuff, lol. thanks. wazilian
King of Wazil
 
ok, i got it. in my html code, i used the input 'id' attribute instead of 'name' (to compliy with XHTML 1.0). so i switched them to 'name', and it worked with the javascript as well. boy, there is a lot to this, thanx eveyone. wazilian
King of Wazil
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top