Skip to main content
Inspiring
April 13, 2010
Question

Passing variables with Confirm message box

  • April 13, 2010
  • 1 reply
  • 4136 views

Hi All,

I'm sure this is basic functionality but I can't for the life of me figure out how to do it.

I have a table with a delete button which when clicked creates a confirm box.

<a href="##" onClick="ColdFusion.MessageBox.create('deleteUserMB', 'confirm', 'Delete Confirmation', 'Are you sure you want to delete this user?', deleteUserCallback, {modal:true})">

     <img src="/admin/images/buttons/btn_ic_delete.png" alt="Delete" width="22" height="22" />

</a>

I then have the callback handler:

var deleteUserCallback = function(btn){

     if(btn == 'yes') {

          ColdFusion.navigate("/admin/sections/users/user-delete.cfm?", "centerArea");

     }

}

Which then calls the page which processes the delete.

So my question is how do I send the id of the user that is to be deleted to the user-delete.cfm page?

Any help would be great.

    This topic has been closed for replies.

    1 reply

    BKBK
    Community Expert
    Community Expert
    April 13, 2010

    What about something like

    ColdFusion.navigate("/admin/sections/users/user-delete.cfm?user_id=1234", "centerArea");

    Inspiring
    April 13, 2010

    Yeah but how do I get the id number into the javascript function.

    From what I can tell you cant pass variables through the message box. As you can only pass the message box name when you call

    ColdFusion.MessageBox.show(messageBoxName);

    BKBK
    Community Expert
    Community Expert
    April 13, 2010

    spill wrote:

    Yeah but how do I get the id number into the javascript function.

    I was answering the question:

    how do I send the id of the user that is to be deleted to the user-delete.cfm page?