p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0

Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 19th, 2007, 03:33 PM
Authorized User
Points: 225, Level: 4
Points: 225, Level: 4 Points: 225, Level: 4 Points: 225, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2006
Location: Houston, TX, USA.
Posts: 52
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ricespn
Default JavaScript Confirm Box

Hi guys,

I have an alert window that shows the action being done, but I would like to use a confirm window to to ask the user if he really want to perform that action, my question is How do I pass the value from that answer to a VBScript variable so I can then decide to perform that action or cancel it.

This is the code that I have now:

<%
if method = "DELETE" then

    ' Delete PL
    strsql = "delete from ftx_bisi_pl where PL = '" & budel & "'"
    set PLdelRS = eadoObj.SaveRecordsetQuery(CStr(strsql))
    'Response.Write (strsql)
%>
    <script language="JavaScript">
    alert("Deleting PL successful!");
    window.location="ProductionLine.asp";
    </script>
<%
end if
%>


This is what I was thinking:

<script language="JavaScript">
var answer;
answer=window.confirm("Deleting PL successful!");
window.location="ProductionLine.asp";
</script>
<%
If answer then

   ' Delete PL
   strsql = "delete from ftx_bisi_pl where PL = '" & budel & "'"
   set PLdelRS = eadoObj.SaveRecordsetQuery(CStr(strsql))
   'Response.Write (strsql)

end if
%>

=======================
Strange and crazy, but everything is possible
__________________
=======================
Strange and crazy, but everything is possible
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old January 20th, 2007, 12:48 AM
Authorized User
 
Join Date: Jan 2007
Location: , , India.
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to saurabhj Send a message via Yahoo to saurabhj
Default

Use Following code:

//Javascript Function
<script language="Javascript">
function doDelete(id)
{
    if(confirm("Are you sure want to delete this employee?"))
    {
        window.location.href="yourpage.asp?del="+id;
    }
}
</Script>

Now you can pass the id as follow:
<input type="Button" name="delete" Value="Delete" OnClick="doDelete('<%=id%>')">

Hope this will help...

-Saurabhj



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript confirm box with just an 'OK' button crmpicco Javascript How-To 26 June 24th, 2008 09:44 AM
Javascript Confirm Message box itHighway Javascript How-To 5 September 25th, 2006 03:51 AM
need Confirm() with Yes/No buttons in JavaScript ehelpcornet ASP.NET 1.0 and 1.1 Basics 1 June 3rd, 2004 08:32 AM
Confirm alert box - need help, Please! larry HTML Code Clinic 1 January 25th, 2004 02:07 AM
how to default confirm box to NO in javascript. An Javascript 1 June 8th, 2003 08:34 AM



All times are GMT -4. The time now is 06:25 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc