Results 1 to 2 of 2

Thread: help!

  1. #1
    est Guest

    Default help!

    i never used jscript before, and now i&#039m a little stuck. when the user wants to delete something, i want a popup box to ask if he is sure he wants to delete.<BR>if he is sure, i want the next line to take him to delete.asp, and pass along with him his id, and Action=Delete. is this possible, and how?<BR>Thanks in advance.

  2. #2
    Bruno Santos Guest

    Default RE: help!

    hi est!&nbsp;&nbsp;Don&#039t worry, be happy!!!&nbsp;&nbsp;:)<BR><BR>you can let the user choose wether or not to do something by using the confirm() jscript function:<BR><BR>if (window.confirm("Do you really wanna do this, dude?"))<BR>{<BR> = "delete.asp?theID=" + myID + "&theaction=Delete";<BR>}<BR><BR>or, if you have a FORM containing the ID, create a hidden input to store the Action to perform, and submit it:<BR><BR>if (window.confirm("Do you really wanna do this, dude?"))<BR>{<BR>&nbsp;&nbsp;&nbsp;with (document.forms.item("myform"))<BR>&nbsp;&nbsp;&nb sp;{<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;theact ion.value = "Delete";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a ction="delete.asp";<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;submit();<BR>&nbsp;&nbsp;&nbsp;};<BR>}<BR ><BR>...<BR><BR>&#060;form name="myform"&#062;<BR>&#060;input type="hidden" id="theaction"&#062;<BR>...<BR>&#060;input type="hidden" id="theID" value="??????"&#062;<BR>...<BR>&#060;/form&#062;<BR><BR><BR>Bruno (<BR>

Posting Permissions

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