Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Confirm delete

Status
Not open for further replies.

EricE

IS-IT--Management
Oct 6, 2000
17
0
0
US
I have a Cold Fusion based calendar. I have(graphic) button on it that allows a user to delete stuff off the calendar when clicking it. I want a "are you sure"? I know I can use javascript, but my problem arises since the "button" has to pass javascript variables through url parameters.

<a href=&quot;calendar2_action.cfm?delete=yes&EventID=#Events.EventID#&month=#url.month#&day=#url.day#&year=#url.year#&type=#url.type#&quot;><img src=&quot;images/delete.gif&quot; border=&quot;0&quot;></a>

How can I make this work by passing the url variables and poping up a &quot;Are you sure&quot; box with an OK and CANCEL option?
 
You could change the link to something like:
Code:
<a href=&quot;calendar2_action.cfm?delete=check&EventID=#Events.EventID#&month=#url.month#&day=#url.day#
&year=#url.year#&type=#url.type#&quot;><img src=&quot;images/delete.gif&quot; border=&quot;0&quot;></a>
Then on the calendar2_action.cfm page do something like...
Code:
<cfswitch expression=&quot;#delete#&quot;>

  <cfcase value=&quot;check&quot;>
    <a href=&quot;calendar2_action.cfm?delete=yes&EventID=#url.EventID#&month=#url.month#&
day=#url.day#&year=#url.year#&type=#url.type#&quot;>Yes</a> 
    <a href=&quot;calendar2_action.cfm?delete=no&EventID=#url.EventID#&month=#url.month#&
day=#url.day#&year=#url.year#&type=#url.type#&quot;>No</a>
  </cfcase>

  <cfcase value=&quot;yes&quot;>
  <!--- delete code goes here --->
  </cfcase>

  <cfcase value=&quot;no&quot;>
  Item not deleted
  </cfcase>

</cfswitch>
Hope this helps... [sig][/sig]
 
Thanks Darkman, that works great! [sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top