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

asp and javascript

Status
Not open for further replies.

travmak

Programmer
Apr 26, 2002
133
US
How do i take a javascript var and make it an asp session var?

here is what i want to do.
<script language = &quot;javascript&quot;>
var newphone = prompt('<% response.write(session(&quot;fname&quot;) & &quot; &quot; & session(&quot;lname&quot;)) %> please update Work Phone Number.','<%response.write(rspers(&quot;WORKNUMBER&quot;))%>');
</script>

<% session(&quot;newphone&quot;) = newphone %>

I've tried it both inside and out of the <script> tags I don't get an error either place, but if i do a response.write(&quot;new phone : &quot; & session(&quot;newphone&quot;)) It comes up
newphone :


 
Try something like this. You might need to debug the syntax a little. Let me know if it works ?
e.g.

<%
if Request.QueryString(&quot;wknumber&quot;) <> &quot;&quot; then
Response.Write rspers(Request.QueryString(&quot;wknumber&quot;))
else
%>

<script language = &quot;javascript&quot;>
var newphone = prompt('<% response.write(session(&quot;fname&quot;) & &quot; &quot; & session(&quot;lname&quot;)) %> please update Work Phone Number.','<%response.write(rspers(&quot;WORKNUMBER&quot;))%>');
document.location.href = &quot;filename.asp?wknumber=&quot; & newphone

</script>

<%
session(&quot;newphone&quot;) = newphone

end if
%>
 
Opps the bottom bit is alittle off - I'm doing a million things at once.

<%
session(&quot;newphone&quot;) = Request.QueryString(&quot;wknumber&quot;)

end if
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top