confirming delete
Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=23106
Printed Date: 29 March 2026 at 10:25am Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com
Topic: confirming delete
Posted By: mkbutler
Subject: confirming delete
Date Posted: 13 April 2007 at 6:34pm
First of all may I congratulate whoever wrote the tutorials. I have the database created and almost ready to put "live". But I can't get 1 little things to work:
Response.Write ("<a href=""deleteStudent.asp?ID_No=" & rsStudents("uniqueRecordID")& """>")
I want to add to this a confirm delete, but everytime I do, it says that a paren is expected. I can get the confirm to work as just a "Click Here" without asp, but when I add it to the Response.Write - paren expected.
Any gurus that can help me?
|
Replies:
Posted By: Scotty32
Date Posted: 13 April 2007 at 7:10pm
you can do it with Javascripts (which am guessing your trying to use) by doing the following:
Response.Write ("<a href=""deleteStudent.asp?ID_No=" & rsStudents("uniqueRecordID")& """ onClick=""return confrim('Are you sure you want to delete this?';)"">") |
when using Response.Write, you use the quotes to encase your 'string'. but if you want to acctually write a quotation mark in html, you need to put double quotes (as you can see in this example), as ASP will cancel it out, rather than ending the string when it gets to the first quote.
so just remember to always use double quotes when putting HTML in Reponse.Write.
------------- S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins
For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .
|
Posted By: mkbutler
Date Posted: 13 April 2007 at 7:17pm
|
I don't see any example? Can you try to show me an example of what you are talking about or what I am doing wrong.
|
Posted By: Scotty32
Date Posted: 13 April 2007 at 7:46pm
well the code you posted, and i posted.
you will notice it has href=""delete, two quotation marks, this is to cancel it out, so the ASP wont process it as the end of the string.
and in my earlier post, i added, in read, the javascript for "confirming delete".
------------- S2H.co.uk - http://www.s2h.co.uk/wwf/" rel="nofollow - WebWiz Mods and Skins
For support on my mods + skins, please use http://www.s2h.co.uk/forum/" rel="nofollow - my forum .
|
|