Results 1 to 2 of 2

Thread: Delete Record Question....

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Location
    Cleveland, Ohio
    Posts
    185

    Question Delete Record Question....

    Below is the content of my delete record page for a simple calendar app that I've done in ASP. I cannot for the life of me figure out what is wrong, but when I go to delete a record, the form has a script at the top that is supposed to make sure the textbox has some text in it. This is not happening and the records are just being deleted. Can anyone see what is wrong with the script at the top or any other reason this would be happening????

    Thanks,

    jpiller

    VB Code:
    1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
    2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    3. <html>
    4. <head>
    5. <title>Delete This Event</title>
    6. <script language="vbscript">
    7.     function CheckForm()
    8.        
    9.         if delevent.Password.value<>delevent.ConfirmPassword.value then
    10.             msgbox "Please enter the event password to delete it!"
    11.             window.event.returnValue = false
    12.         end if
    13.        
    14.     end function
    15. </script>
    16. </head>
    17. <body bgcolor="#99CCFF">
    18. <%
    19. Dim rsEvent
    20. Dim cnEvent
    21. Dim intID
    22.  
    23. intID = Request.QueryString("ID")
    24.  
    25. Set cnEvent = Server.CreateObject("ADODB.Connection")
    26. cnEvent.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("wae_staff.mdb")
    27.  
    28. Set rsEvent = Server.CreateObject("ADODB.Recordset")
    29. rsEvent.Open "SELECT * FROM tblConferenceRoom WHERE EventID = " & intID, cnEvent
    30.  
    31. %>
    32. <center>
    33. <form onSubmit="CheckForm();" name="delevent" action="delete_action.asp?ID=<%=rsEvent("EventID")%>" method="post">
    34.     <h1>Delete Event</h1><br>
    35. <br>
    36. Are you sure you want to delete the <%=rsEvent("Name")%> event scheduled for <%=rsEvent("StartDate")%>
    37. from <%=rsEvent("StartTime")%> to <%=rsEvent("EndTime")%>?
    38. <br>
    39. <br>
    40. Enter the password for this event to delete it:&nbsp;&nbsp;<input type="password" name="Password">
    41. &nbsp;&nbsp;<input type="hidden" value="<%=rsEvent("EventPswd")%>" name="ConfirmPassword">
    42. <input type="submit" value="Delete Event">
    43. </form>
    44. </center>
    45. <%
    46. rsEvent.Close
    47. Set rsEvent = Nothing
    48.  
    49. cnEvent.Close
    50. Set cnEvent = Nothing
    51. %>
    52. </body>
    53. </html>
    "The Force will be with you, always."

    --Ben Kenobi--

  2. #2
    Hyperactive Member
    Join Date
    Nov 2002
    Location
    Someplace 'ore the rainbow
    Posts
    392
    Scripts are finicky, often not raising an error message when not working (I'm having a hayday on my current project with scripts). I've never seen the window.event.returnValue , but I have done "return false;" and in the form onSubmit="return CheckScript". That may or may not help. What I do when I'm having problems is start at the basics of my scripts, and go from there. So I'd just have a simple msgbox saying "Here" so I know the script is being called, and then I work my way down.

    cjqp
    When your answer is the Arc Sin of 1.015, you should check your Pythagorean triple.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width