Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: Launch SQL query, refresh page


Message #1 by "Ken Dietz" <java@k...> on Fri, 8 Nov 2002 21:51:00
I have a website which dynamically lists records from an SQL database.  I 
need to be able to add a Delete button which will do the following:

1.  Ask for confirmation.
2.  Delete the record by executing a stored procedure.
3.  Refresh the page, so the deleted item disappears.

Currently, I am using the following:

<a HREF="http://Server/trData?sql=EXECUTE+deleterecord+[parameters]" 
onClick="return confirm('Are you sure?')">

This asks for confirmation and successfully deletes the record, but the 
browser goes to a blank page, and the user must hit Back and Refresh 
manually.

I'm sure this is a fairly simple task, but I am not experienced with 
Javascript.  I would appreciate any help.

Thanks,
Ken

  Return to Index