Mar 17th, 2014, 2:10 PM
Hi
Still trying to figure out how to add a confirm message when adding a submission.
By way of experiment, I tried to 'copy' the delete submission on the edit submission page whereby I copied the Delete button in edit_submission.tpl and replaced existing Add button with
I then copied the delete_submission js code in manage_submissions.js and changed it to
but I click my new Add button.... absolutely nothing happens... not even Hello World....
I'm a developer but not on Web pages so I could really do with some pointers please?
Still trying to figure out how to add a confirm message when adding a submission.
By way of experiment, I tried to 'copy' the delete submission on the edit submission page whereby I copied the Delete button in edit_submission.tpl and replaced existing Add button with
Code:
<input type="button" name=“add” value="{$LANG.word_delete}" class=“red” onclick="return add_submission({$submission_id}, 'submissions.php')"/>
I then copied the delete_submission js code in manage_submissions.js and changed it to
Code:
/**
* Called on the edit submission page; lets a user add a new submission.
*
* @param integer submission_id
* @param string target_webpage where to link to after adding the submission
*/
ms.add_submission = function(submission_id, target_webpage) {
document.write("Hello World!");
ft.create_dialog({
dialog: ft.check_url_dialog,
title: g.messages["phrase_please_confirm"],
content: g.messages["confirm_delete_submission"],
popup_type: "warning",
buttons: [{
text: g.messages["word_yes"],
click: function() {
window.location = target_webpage + “?add_submission=“ + submission_id;
}
},
{
text: g.messages["word_no"],
click: function() {
$(this).dialog("close");
}
}]
});
return false;
}
but I click my new Add button.... absolutely nothing happens... not even Hello World....
I'm a developer but not on Web pages so I could really do with some pointers please?