Click to See Complete Forum and Search --> : Newbie Help
jcongerton
09-27-2003, 06:41 AM
I need to alert the user he is about to delete a record if confirmed i then need the function to open a new window. I have written the code below, but keep getting an invaild argument error. Any ideas??
<script language="JavaScript">
<!--
function my_#userid#(theURL)
{
var answer=confirm("Your are about to delete this user! Please confirm.")
if(answer)
window.open(theURL, 'Delete user','toolbar=yes, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=400, height=400');
}
//--->
</script>
sciguyryan
09-27-2003, 06:47 AM
Originally posted by jcongerton
<script language="JavaScript">
<!--
function my_#userid#(theURL)
{
var answer=confirm("Your are about to delete this user! Please confirm.")
if(answer)
window.open(theURL, 'Delete user','toolbar=yes, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=400, height=400');
}
//--->
</script> [/B]
i think it should be this:
<script language="JavaScript">
<!--
function my_#userid#(theURL)
{
var answer=confirm("Your are about to delete this user! Please confirm.");
if(answer == true)
{
window.open(theURL, 'Delete user','toolbar=yes, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=no, width=400, height=400');
}
else
{
window.alert("go away!");
}
//--->
</script>
jcongerton
09-27-2003, 06:59 AM
this produces a } expected error, sorry i'm very new to this.
Charles
09-27-2003, 07:06 AM
<script language="JavaScript">
<!--
function myUserId(theURL) {if(confirm('Your are about to delete this user! Please confirm.')) {window.open(theURL, 'deleteUser', 'toolbar,scrollbars,width=400,height=400')} else {window.alert('Very well then.')}}
//--->
</script>
jcongerton
09-27-2003, 07:20 AM
Sorry to be a pain, now i'm back to the invalid argument error, i am using this on a cold fusion server, if this has any bearing.
Charles
09-27-2003, 07:24 AM
Originally posted by jcongerton
Sorry to be a pain, now i'm back to the invalid argument error, i am using this on a cold fusion server, if this has any bearing. Which line is causeing the error? Note that I not only cleaned things up, but I corrected for a few errors, especially in the "window.open()" call. Perhaps it would be best if you gave us the URL.
jcongerton
09-27-2003, 07:27 AM
All sorted now, the last post was correct, i made an error when pasting. Thank you every one for your help.