this is my code, and I am trying to be able to switch between different calendars. But it wont let me
function googleCalendars(portlet, column) {
var calendarSelect;
portlet.setTitle("Sportex Calendars");
calendarSelect = portlet.addField("calendar_select", "select", "Select Calendar");
calendarSelect.setHelpText("Select a calendar");
calendarSelect.addSelectOption("humanresources", "Human Resources");
calendarSelect.addSelectOption("vacation", "Vacations");
calendarSelect.addSelectOption("appointments", "Appointments");
portlet.addField("calendar", "inlinehtml", "Some HTML").setLayoutType("outsidebelow", "startrow").setDefaultValue("" + "<div>" + '<<iframe src="https://calendar.google.com/calendar/embed?height=600&wkst=1&bgcolor=%23ffffff&ctz=America%2FPhoenix&showCalendars=0&src=c3BvcnRleGNhbGVuZGFyQGdtYWlsLmNvbQ&src=YWRkcmVzc2Jvb2sjY29udGFjdHNAZ3JvdXAudi5jYWxlbmRhci5nb29nbGUuY29t&src=ZW4udXNhI2hvbGlkYXlAZ3JvdXAudi5jYWxlbmRhci5nb29nbGUuY29t&src=aHQzamxmYWFjNWxmZDYyNjN1bGZoNHRxbDhAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ&color=%23039BE5&color=%2333B679&color=%230B8043&color=%23B39DDB" style="border:solid 1px #777" width="1200px" height="600px" frameborder="1" scrolling="no"></iframe>' + "</div>");
portlet.addField("resizer", "inlinehtml", "CSS Overrides for Portlet Content Resizing").setDefaultValue("" + "<style>" + "ns-script-portlet-content-wrapper iframe," + "#main_form table, #cal_frame {" + "width: 100%;" + "}" + "</style>");
portlet.setScript("customscript_googlecalendar_client")}
function fieldChange(type, name) {
if(name == "calendar_select") {
if(nlapiGetFieldValue("calendar_select") == "humanresources") {
document.getElementById("cal_frame").src = "https://calendar.google.com/calendar/embed?src=833451c59dcb80fff2263f6cfb17fa5ae246b70d97588f1ef46ffbc04658433b%40group.calendar.google.com&ctz=America/Phoenix"
}else {
if(nlapiGetFieldValue("calendar_select") == "vacation") {
document.getElementById("cal_frame").src = "https://calendar.google.com/calendar/embed?src=f61df42873f6d090babb273c46cd295f12795c08647b8c18088d25691cb653fb%40group.calendar.google.com&ctz=America%2FPhoenix"
}else {
if(nlapiGetFieldValue("calendar_select") == "appointments") {
document.getElementById("cal_frame").src = "https://calendar.google.com/calendar/embed?src=clto48tqq2vmp19sfuqra8oprc%40group.calendar.google.com&ctz=America/Phoenix"
}
}
}}nlapiResizePortlet()};