Sign In | Register Now About Bytes | Help | Site Map
Connecting Tech Pros Worldwide

ASP in Javascript Alert Message

Question posted by: musclehead (Newbie) on February 3rd, 2006 06:21 PM
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!
KUB365's Avatar
KUB365
Administrator
738 Posts
February 3rd, 2006
06:51 PM
#2

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?

Reply
musclehead's Avatar
musclehead
Newbie
4 Posts
February 8th, 2006
01:18 PM
#3

Re: ASP in Javascript Alert Message
Hmmm...still not working, I guess I'll just keep messing with it. Thanks!

Reply
Johnbat's Avatar
Johnbat
Newbie
1 Posts
June 29th, 2006
03:24 PM
#4

Re: ASP in Javascript Alert Message
Great thread thanks

Reply
Reply
Not the answer you were looking for? Post your question . . .
189,324 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Latest Articles: Read & Comment
Top Javascript / DHTML / Ajax Forum Contributors