The code does not work, and I have tried many times without success. I'm using this to confirm deletion of records in a MySQL database, so it's important for the users.
In my php script (and in the resultant html code) I have this:And in my javascript section I have this:Code:echo('<div class="managedel"><input type="Submit" name="file4" value="Delete" onClick="return confirmDelete();"></div>');Nothing happens, not even the pop-up window. Could it be that the method in not a part of FF or IE any longer? Is there another substitute? Oh, BTW, I have tried to call the function with onSubmit, as well as onClick.....Code:myWindow = window.open("", "responseWindow", 'toolbar, width=200, height=100') function confirmDelete() { myWindow.document.write("Click 'O.K'. to delete or 'Cancel' to resume") var answer = confirm("Are you sure you want to delete these records?"); if(answer) { document.location = <? echo $_SERVER['PHP_SELF'];?>; } else { return false; } }



Reply With Quote



Bookmarks