By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,188 Members | 832 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,188 IT Pros & Developers. It's quick & easy.

ASP in Javascript Alert Message

P: 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!
Feb 3 '06 #1
Share this Question
Share on Google+
3 Replies


Expert Mod 100+
P: 2,327
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.  
Feb 3 '06 #2

P: 4
Hmmm...still not working, I guess I'll just keep messing with it. Thanks!
Feb 8 '06 #3

P: 1
Great thread thanks
Jun 29 '06 #4

Post your reply

Sign in to post your reply or Sign up for a free account.