Hi,
I'm creating some buttons on the fly for use in a jQuery dialog box. I'm trying to add a function so that when the button is clicked, my function runs. For some reason, the way I'm doing it my function is running automatically. I want it to run when the button is clicked, but I'm not quite sure of the syntax since I'm passing a set of params to the dialog box on the fly.
My button does display, but something is not quite right with the function part. I don't think it's set to work on click like it should be.
Here is my code that gets passed into a function that creates the dialog box:
- params.dialogTitle = 'Customer Service';
params.btns = {};
params.btns['My Button Text'] = function(){
$.post(
"remote.cfc?method=someMethod",
{ customerId: "4" },
function(data) {
$('#myDiv').html( data );
}
);
};
Any help appreciated.
Thanks,