Submit btn, vbCancel

Results 1 to 2 of 2

Thread: Submit btn, vbCancel

  1. #1
    Join Date
    Dec 1969

    Default Submit btn, vbCancel

    I have a form with a submit button and when the user clicks on the submit btn i want to present a msgbox asking for a confirmation for deletion. They can either choose Ok or Cancel. If they select Cancel I want to go to another page instead of Cancel. What am I doing wrong in this code? Thanks.<BR><BR><BR>Sub submit_OnClick() <BR><BR> dim hldAction <BR> hldAction = msgbox "Are you sure you want to delete these classes?",vbOKCancel,"Parenting Seminar Application" <BR> msgbox "hldAction--" & hldAction<BR> If hldAction = vbCancel Then <BR> window.location.href = "authenticated.asp"<BR> End If<BR> <BR>End Sub<BR><BR><BR><BR><BR>&#060;td width="10%"&#062;&#060;input type="submit" name="submit" style="font-weight:bold;" value="Delete Selected Classes"&#062;&#060;/td&#062;<BR><BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Submit btn, vbCancel

    put your message box in parentheses<BR><BR>hldAction = msgbox("Are you sure you want to delete these classes?",vbOKCancel,"Parenting Seminar Application")<BR><BR>Other than that, the logic doesn&#039;t seem to flow...<BR>between end if and end sub should be some code that handles deletion. If that code is handled elsewhere, it might end up deleteing even though it does redirect... And make sure your form won&#039;t submit if, in fact, a person does click cancel.<BR><BR>I&#039;m not too great with vbscript though, so you might have other problems.<BR>Good Luck bud,<BR>Trey

Posting Permissions

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