Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 17th, 2005, 01:26 AM
Authorized User
 
Join Date: Jun 2003
Posts: 90
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to tdaustin Send a message via Yahoo to tdaustin
Default Passing a ASP varible to a javascript

Hi all,

Im currently writing a script that allows a multiple records to be selected for editing. The only thing that changes is the id number eg. edit.asp?SID=123

Then i use loop through all the ids and open the edit page passing the id along. The only problem is i cant pass the asp variable that holds the record number to open

how do i output my ASP variable into the javascript url section

heres the code
Code:
<%

SID = Request.Form("select")
SelectAll = Request.Form("SelectAll")
' split profile id's into array

SID = Split(SID,",")
ProfileCount = 0

' loop though ids and open window with javascript
Do While Not ProfileCount > Ubound(SID)
ProfileCount = ProfileCount + 1
%>

<SCRIPT language="JavaScript1.2">

{
    window.open("../Profile_Edit.asp?SID=ineedmyvariablehere");
}
</SCRIPT>
<%
Loop
%>
Thanks Tim:)

TDA
__________________
TDA
 
Old May 17th, 2005, 01:44 AM
Friend of Wrox
 
Join Date: May 2004
Posts: 642
Thanks: 0
Thanked 43 Times in 42 Posts
Default

Hi
Please try:
window.open("../Profile_Edit.asp?SID=<%=asp_variable_name%>");

Om Prakash





Similar Threads
Thread Thread Starter Forum Replies Last Post
Passing values from asp to a javascript Abhilash Classic ASP Basics 11 June 15th, 2011 12:38 PM
Passing asp control id to javascript jazzcatone ASP.NET 1.0 and 1.1 Professional 0 October 18th, 2006 01:38 PM
Passing Javascript Variables to Asp.Net? Grumpy ASP.NET 2.0 Basics 4 September 8th, 2006 11:52 PM
passing data btwn asp page and javascript include Justine Classic ASP Professional 8 August 20th, 2004 02:23 AM
Varible mrideout BOOK: Beginning ASP.NET 1.0 3 July 22nd, 2004 01:57 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.