/    Sign up×
Community /Pin to ProfileBookmark

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>

to post a comment
JavaScript

6 Comments(s)

Copy linkTweet thisAlerts:
@sciguyryanSep 27.2003 — [i]Originally posted by jcongerton [/i]

<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][/QUOTE]


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>
Copy linkTweet thisAlerts:
@jcongertonauthorSep 27.2003 — this produces a } expected error, sorry i'm very new to this.
Copy linkTweet thisAlerts:
@CharlesSep 27.2003 — [font=monospace]<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>[/font]
Copy linkTweet thisAlerts:
@jcongertonauthorSep 27.2003 — 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.
Copy linkTweet thisAlerts:
@CharlesSep 27.2003 — [i]Originally posted by jcongerton [/i]

[B]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. [/B][/QUOTE]
[font=georgia]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.[/font]
Copy linkTweet thisAlerts:
@jcongertonauthorSep 27.2003 — All sorted now, the last post was correct, i made an error when pasting. Thank you every one for your help.
×

Success!

Help @jcongerton spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...