Skip to content

Instantly share code, notes, and snippets.

@kemiller2002
Created August 12, 2016 19:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kemiller2002/84f6e6746fa9327f0216c87f379ae472 to your computer and use it in GitHub Desktop.
Save kemiller2002/84f6e6746fa9327f0216c87f379ae472 to your computer and use it in GitHub Desktop.
<html>
<body>
<script src="https://code.jquery.com/jquery-3.1.0.min.js" integrity="sha256-cCueBR6CsyA4/9szpPfrX3s49M9vUU5BgtiJj06wt/s=" crossorigin="anonymous"></script>
<input type="button" class="btnSaveParameters" id="btn_SaveCriteria"
onclick="return btn_SaveCriteria_onclick()"
value="Save Subscription" />
<script >
function btn_SaveCriteria_onclick() {
//Testing if function fires:
window.alert(5 + 6);
var availableSelects = [];
$("Select").each(function () {
availableSelects.push($(this).attr("id"));
});
if ($("#" + availableSelects[1]).find(":selected").text() + $("#" + availableSelects[2]).find(":selected").text()+$("#" + availableSelects[2]).find(":selected").text() ==='AllAllAll') {
$(".PageTitle").append("<div id='dialog' title='Parameter Warning'>You cannot select all for all 3 filters</div>");
$("#dialog").dialog();
} else {
var t = document.getElementById("modal-form").cloneNode(true);
t.style.display = "inline";
var options = { title: "Add a Description to your Subscription", width: 500, height: 100, dialogReturnValueCallback: MyDialogClosed, html: t };//$('<div id="pgDiv"><form id="pgForm" method="post"><input type="text" name="Description" id="pgDescription>Description: </form></div>').get(0) };
SP.SOD.execute('sp.ui.dialog.js', 'SP.UI.ModalDialog.showModalDialog', options);
}
}
</script>
</body></html>
@JASoules
Copy link

I'm a complete newbie, but doesn't it need at the top?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment