Connecting Tech Pros Worldwide Help | Site Map

ASP in Javascript Alert Message

 
LinkBack Thread Tools Search this Thread
  #1  
Old February 3rd, 2006, 06:21 PM
Newbie
 
Join Date: Feb 2006
Posts: 4
Default ASP in Javascript Alert Message

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!
Reply
  #2  
Old February 3rd, 2006, 06:51 PM
KUB365's Avatar
Administrator
 
Join Date: Jul 2005
Location: Portland, OR
Age: 28
Posts: 861
Default

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.  
Reply
  #3  
Old February 8th, 2006, 01:18 PM
Newbie
 
Join Date: Feb 2006
Posts: 4
Default

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

Great thread thanks
Reply
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search


Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.