Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - can JavaScript being called from a link
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

can JavaScript being called from a link

 Post Reply Post Reply
Author
amisima View Drop Down
Newbie
Newbie


Joined: 09 June 2003
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote amisima Quote  Post ReplyReply Direct Link To This Post Topic: can JavaScript being called from a link
    Posted: 13 August 2003 at 12:33pm
Hi,

Does anyone know if there is such a thing as a JavaScript function being called from a link?

I have a delete page, the user types in a word to be deleted form the oracle database. The page then displays the record as a link. The user clicks the link and the record is deleted. I want to have an alert "Are you sure you want to delete?" when the user clicks on the link. Has anyone come across this before?

Thanks,

Amisima
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 13 August 2003 at 12:42pm
<a href="whateverthelinkistodelete" onClick="return confirm('Are you sure you want to delete?')">Link Text</a>
Contribute to the working anarchy we fondly call the Internet
Back to Top
amisima View Drop Down
Newbie
Newbie


Joined: 09 June 2003
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote amisima Quote  Post ReplyReply Direct Link To This Post Posted: 13 August 2003 at 12:54pm
Thank you for your guick response.
I tryed to add the on click to my link but I got errors. This is my link with out the on click

<%Response.Write ("<a href=""CATS_Term_Record_Deleted.asp?ID_no=" & rs("term_ID") & """>")%>
        <td><b>{EN}</b></td>
        <td><b><%Response.Write (rs("title")) %></b></td>

this is what I have tryed
<%Response.Write ("<a href=""CATS_Term_Record_Deleted.asp?ID_no=" & rs("term_ID") & onClick="return confirm('Are you sure you want to delete?')"""">")%>

this is my result with the on click

False ' {EN} test
False ' {EN} test

can you give me any advice?

thanks,

amisima
Back to Top
MorningZ View Drop Down
Senior Member
Senior Member
Avatar

Joined: 06 May 2002
Location: United States
Status: Offline
Points: 1793
Post Options Post Options   Thanks (0) Thanks(0)   Quote MorningZ Quote  Post ReplyReply Direct Link To This Post Posted: 13 August 2003 at 1:05pm

yuck.. you can be a lot neater than that when writing code..

try:

<a href="CATS_Term_Record_Deleted.asp?ID_no=<%= rs("term_ID") %>" onClick="return confirm('Are you sure you want to delete?')">

in your code, you didnt close the "href" parameter

Contribute to the working anarchy we fondly call the Internet
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.