Hi all
I am probably missing something simple here, I am using jQuery Dialog and I am trying to pass the Button text to the dialog function in the following manner:
<script type="text/javascript">
function showDialog($url, $title, $form_id, $buttontext)
{
$('<div>').dialog({
modal: true,
open: function ()
{
$(this).load($url);
},
height: 500,
width: 700,
title: $title,
buttons: {
$buttontext: function() {
$($form_id).submit();
$( this ).dialog( "close" );
},
Cancel: function() {
$( this ).dialog( "close" );
}
}
});
};
</script>
And I am passing the following:
<a href="#" onclick="showDialog('templates/dialogs/dialog.editcheckpoint.php', 'Edit Checkpoint', '#editcheckpoint', 'Update Checkpoint');\\">Edit</a>
This works all apart from the button text which remains as $buttontext where it should be ‘Update Checkpoint’
I am sure I am missing something obvious or doing something stupid! I use the same Dialog function for a number of different tasks in the interface so want to customize the button text as I do with the title etc.
Thanks for any help
Matt