A JS variable is not passed when you post the form. You can use a hidden
form field. But easier is to just do the whole thing in JS and don't
post if the user clicks cancel:

function delete_presentation()
{
return confirm("Do you really want to delete this
presentation??");
}

Pascal

> -----Original Message-----
> From: Brett Barnhart [mailto:[EMAIL PROTECTED]
> Sent: 13 September 2004 18:15
> To: CF-Talk
> Subject: Incorporating _javascript_ to confirm into a document...
>
> I've been working on this all morning and I am missing something. I
have a
> delete button on a page and I want a _javascript_ Confirm box to pop up.
>
> I am trying to assign a variable in the _javascript_ and then Test that
> script
> in my <CFIF>. This works fine until I add the confirmation box.
>
>
> I declare the variable
> <CFPARAM NAME="confirm_delete_presentation" Default="false">
>
>
> Here is my _javascript_
>
> function delete_presentation()
> {
>  confirm_delete_presentation= confirm("Do you really want to delete
this
> presentation??");
>  }
>
> Here is my <CFIF>
>
> <CFIF IsDefined("form.delete.x") and badFlags EQ "" and
> confirm_delete_presentation EQ "true">
> -- Script to do the deleting
> </CFIF>
>
>
> and finally my button
>
> <INPUT TYPE="image" NAME="delete" SRC=""> > ALT="Delete
> Presentation" > >
> Any hints?
>
> Thanks!
> Brett
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to