I am trying to access some javascript code inside an aspx page which has a master page reference. I created a ContentPlaceHolder in the head to hold the javascript references.
<asp:ContentPlaceHolder ID="HeadContentPlaceHolder" runat="server">
<title>Sign Matrix</title>
<link rel="Stylesheet" href="StyleSheet.css" type="text/css" />
<script src="Scripts/jquery.min.js" type="text/javascript"></script>
<script src="Scripts/jquery-ui.js" type="text/javascript"></script>
<link href="Styles/jquery-ui.css" rel="stylesheet" type="text/css" />
</asp:ContentPlaceHolder>
inside of my aspx page the code is as follows
<asp:Content ID="Content2" ContentPlaceHolderID="HeadContentPlaceHolder" runat="server">
<script language="javascript" type="text/javascript">
function body_onLoad() {
var radioButtons = document.getElementsByName("rblAd");
if (radioButtons.length != 0) {
if (document.forms['form1'].hfLevelTypeID.value == "4") {
radioButtons[3].style.visibility = 'hidden';
}
var which = 2;
if (document.forms['form1'].hfAhead.value != "")
which = parseInt(document.forms['form1'].hfAhead.value, 10) + 2;
if (which >= 0 && which <= 3)
radioButtons[which].checked = true;
}
}
function setSelectedIndex(s, v) {
for (var i = 0; i < s.options.length; i++) {
if (s.options[i].value == v) {
s.options[i].selected = true;
return;
}
}
}
function rblAd_onClick(e) {
if (!e)
e = event;
var obj = e.target || e.srcElement;
document.forms['form1'].hfAhead.value = obj.value;
if (document.forms['form1'].hfLevelTypeID.value != "4") {
setSelectedIndex(document.forms['form1'].ddlWeek, document.forms['form1'].hfAhead.value);
}
document.forms['form1'].action = 'listSignBeta.aspx?hfAction=' + document.forms['form1'].hfAction.value + '&hfDepartment=' + document.forms['form1'].hfDepartment.value + '&hfTier=' + document.forms['form1'].hfTier.value + '&hfSignTypeID=' + document.forms['form1'].hfSignTypeID.value + '&hfAhead=' + document.forms['form1'].hfAhead.value;
document.forms['form1'].enctype = "application/x-www-form-urlencoded";
document.forms['form1'].submit();
}
function btnEnd_onclick() {
var confirm = window.confirm("Are you sure you want to end Sign Share?")
if (confirm) {
document.forms['form1'].action = 'end.aspx';
document.forms['form1'].enctype = "application/x-www-form-urlencoded";
document.forms['form1'].submit();
return true;
}
else
return false
}
function getRadioCheckValue(cbIncludeBatch) {
var oRadio = document.forms['form1'].elements[cbIncludeBatch];
for (var i = 0; i < oRadio.length; i++) {
if (oRadio[i].checked) {
return oRadio[i].value;
}
}
return '';
}
function cbIncludeBatch_onclick(cbIncludeBatch)
{
var count = document.getElementsByName("cbIncludeBatch");
for (var i = 0; i < count.length; i++)
{
if (count[i].checked)
{
var agree = window.confirm("This request involves a large number of signs and will take a few moments. Would you like to proceed?");
if (agree) {
document.forms['form1'].action = 'listSignBeta.aspx?hfAction=' + document.forms['form1'].hfAction.value + '&hfDepartment=' + document.forms['form1'].hfDepartment.value + '&hfTier=' + document.forms['form1'].hfTier.value + '&hfSignTypeID=' + document.forms['form1'].hfSignTypeID.value + '&hfAhead=' + document.forms['form1'].hfAhead.value + '&hfIncludeBatch=true';
document.forms['form1'].enctype = "application/x-www-form-urlencoded";
document.forms['form1'].submit();
return true;
}
else
count[i].checked = false;
return false
}
else
document.forms['form1'].action = 'listSignBeta.aspx?hfAction=' + document.forms['form1'].hfAction.value + '&hfDepartment=' + document.forms['form1'].hfDepartment.value + '&hfTier=' + document.forms['form1'].hfTier.value + '&hfSignTypeID=' + document.forms['form1'].hfSignTypeID.value + '&hfAhead=' + document.forms['form1'].hfAhead.value + '&hfIncludeBatch=false';
document.forms['form1'].enctype = "application/x-www-form-urlencoded";
document.forms['form1'].submit();
count[i].checked = false;
return false
}
}
function btnEdit_onClick(id) {
var sep1 = id.indexOf("_");
var sep2 = id.indexOf("_", sep1 + 1);
var sep3 = id.indexOf("_", sep2 + 1);
var sep4 = id.indexOf("_", sep3 + 1);
document.forms['form1'].hfSignID.value = id.substring(0, sep1);
document.forms['form1'].hfSignLevelID.value = id.substring(sep1 + 1, sep2);
document.forms['form1'].hfStampID.value = id.substring(sep2 + 1, sep3);
document.forms['form1'].hfSignLevelTypeID.value = id.substring(sep3 + 1, sep4);
document.forms['form1'].hfSizeID.value = id.substring(sep4 + 1);
document.forms['form1'].action = 'oneSign.aspx?hfSignID=' + document.forms['form1'].hfSignID.value + '&hfSignLevelID=' + document.forms['form1'].hfSignLevelID.value + '&hfStampID=' + document.forms['form1'].hfStampID.value + '&hfSignLevelTypeID=' + document.forms['form1'].hfSignLevelTypeID.value + '&hfSizeID=' + document.forms['form1'].hfSizeID.value + '&hfLevelID=' + document.forms['form1'].hfLevelID.value + '&hfLevelTypeID=' + document.forms['form1'].hfLevelTypeID.value + '&hfLevelUserInfoID=' + document.forms['form1'].hfLevelUserInfoID.value + '&hfAction=' + document.forms['form1'].hfAction.value + '&hfDepartment=' + document.forms['form1'].hfDepartment.value + '&hfTier=' + document.forms['form1'].hfTier.value + '&hfSignTypeID=' + document.forms['form1'].hfSignTypeID.value + '&hfAhead=' + document.forms['form1'].hfAhead.value;
document.forms['form1'].enctype = "application/x-www-form-urlencoded";
document.forms['form1'].submit();
}
function printWindow() {
window.print();
}
$(window).bind('load', function () {
var headerChk = $(".cssPrintAll input");
var itemChk = $(".cssPrintItem input");
headerChk.bind("click", function () {
itemChk.each(function () { this.checked = headerChk[0].checked; })
}
);
itemChk.bind("click", function () { if ($(this).checked == false) headerChk[0].checked = false; });
var delheaderChk = $(".cssDeleteAll input");
var delitemChk = $(".cssDeleteItem input");
delheaderChk.bind("click", function () {
delitemChk.each(function () { this.checked = delheaderChk[0].checked; })
}
);
delitemChk.bind("click", function () { if ($(this).checked == false) delheaderChk[0].checked = false; });
var selheaderChk = $(".cssSelectAll input");
var selitemChk = $(".cssSelectItem input");
selheaderChk.bind("click", function () {
selitemChk.each(function () { this.checked = selheaderChk[0].checked; })
}
);
selitemChk.bind("click", function () { if ($(this).checked == false) selheaderChk[0].checked = false; });
});
</script>
</asp:Content>
after that i have another content placeholder that holds the buttons that require the javascript. Please advise