Connecting Tech Pros Worldwide Help | Site Map

ASP in Javascript Alert Message

  #1  
Old February 3rd, 2006, 07:21 PM
Newbie
 
Join Date: Feb 2006
Posts: 4
Hi everyone,

I have, what I hope, will be a simple question. I have a basic JS function to pop-up a confirm delete dialog box when deleting a record from a DB:

function confirmDelete()
{
var agree=confirm("Confirm record deletion?");
if (agree)
return true ;
else
return false ;
}

and the call in the ASP:

<a onClick='return confirmDelete();' href='deleteRecord.asp?id=" & rec("ID") & "'>

This is working perfectly. What I want to know is if there's a way to insert the rec("ID") into the JS alert message, to produce the following:

"Confirm record 1234 deletion?" or "Confirm record 9384 deletion?"

I don't know if this is even possible, but it sure would look nice! Thanks in advance!
  #2  
Old February 3rd, 2006, 07:51 PM
KUB365's Avatar
Administrator
 
Join Date: Jul 2005
Location: Portland, OR
Posts: 942
Provided Answers: 1

re: ASP in Javascript Alert Message


Well in the URL, I see "delete.asp?id=" . So you are sending a variable via GET. It should be accessible in ASP.

Example:
Expand|Select|Wrap|Line Numbers
  1. <%
  2. id = request.querystring("id")
  3. &>
  4.  
  5. Confirm record <%=id%> for deletion?
  6.  
  #3  
Old February 8th, 2006, 02:18 PM
Newbie
 
Join Date: Feb 2006
Posts: 4

re: ASP in Javascript Alert Message


Hmmm...still not working, I guess I'll just keep messing with it. Thanks!
  #4  
Old June 29th, 2006, 04:24 PM
Newbie
 
Join Date: Jun 2006
Posts: 1

re: ASP in Javascript Alert Message


Great thread thanks
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Display ASP .NET Error in JavaScript Alert Window. jehugaleahsa@gmail.com answers 4 December 26th, 2007 09:15 PM
JavaScript alert message appear after the insert statement is completed somtabu answers 1 November 25th, 2007 10:08 PM
Javascript alert message problem Tony Girgenti answers 22 October 16th, 2006 09:55 PM
Javascript alert - Smart Navigation problem Marc Castrechini answers 2 November 18th, 2005 08:28 AM