
Out There Calendar
| « | May 2010 | » |
| May 2010 | ||||||
|---|---|---|---|---|---|---|
| Mon | Tue | Wed | Thu | Fri | Sat | Sun |
| 26 | 27 | 28 | 29 | 30 | 1 | 2 |
| 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| 10 | 11 | 12 | 13 | 14 | 15 | 16 |
| 17 | 18 | 19 | 20 | 21 | 22 | 23 |
| 24 | 25 | 26 | 27 | 28 | 29 | 30 |
| 31 | 1 | 2 | 3 | 4 | 5 | 6 |
//
// Customise the Out There Calendar. Show the following event types:
All events
Wire Events
Special Events
International Festivals
On Stage
Club Spaces
UK Festivals
Update Out There Calendar
// <![CDATA[
var fieldstocheck = new Array();
fieldnames = new Array();
function submitForm (objid) {
if (checkform) {
swapMailingListContent(objid);
}
return false;
}
function addFieldToCheck(value,name) {
fieldstocheck[fieldstocheck.length] = value;
fieldnames[fieldnames.length] = name;
}
function checkform() {
for (i=0;i<fieldstocheck.length;i++) {
if (eval(“document.subscribeform.elements[\'”+fieldstocheck[i]+”\’].value”) == “”) {
alert(“Please enter your “+fieldnames[i]);
eval(“document.subscribeform.elements[\'”+fieldstocheck[i]+”\’].focus()”);
return false;
}
}
}
function swapMailingListContent (objid) {
if (!(document.forms[‘subscribeform’])){
return false;
}
// create a boolean variable to check for a valid IE instance
var xmlhttp = false;
var obj = document.getElementById(objid);
var chosen = “”;
for (i = 0; i <document.forms[‘subscribeform’].elements[‘sub’].length; i++) {
if (document.forms[‘subscribeform’].elements[‘sub’][i].checked) {
chosen = document.forms[‘subscribeform’].elements[‘sub’][i].value
}
}
var serverpage = chosen.match(‘unsub’) ? “http://www.thewire.co.uk/elements/ajaxSubscribe.php5?p=unsubscribe” : “http://www.thewire.co.uk/elements/ajaxSubscribe.php5?p=subscribe”;
// var params = “email=” + document.forms[‘subscribeform’].elements[“email”].value + “&” + “list[1]=” + document.forms[‘subscribeform’].elements[“list[1]”].value ;
var formdata = ”;
var foundOne=false;
for (i = 0; i < document.forms[‘subscribeform’].elements.length; i++) { // loop through all the form elements
formElem = document.forms[‘subscribeform’].elements[i];
switch (formElem.type) {
case ‘text’:
case ‘hidden’:
case ‘password’:
case ‘textarea’:
formdata += formElem.name + ‘=’ + escape(formElem.value) + ‘&’;
break;
case ‘checkbox’:
if (formElem.checked===true) {
formdata += formElem.name + ‘=’ + formElem.value + ‘&’;
foundOne=true;
}
break;
case ‘radio’:
if (formElem.checked===true) {
formdata += formElem.name + ‘=’ + formElem.value + ‘&’;
}
break;
default:
formdata += formElem.name + ‘=’ + escape(formElem.value) + ‘&’; // setting a default is all-important
} // end switch
} // end for loop
formdata = formdata.substr(0,(formdata.length -1)); // snip off extra ampersand at the end of the string
formdata += “&objID=” + escape(objid); // pass objid as well in case of error, & we need to rewrite the form
if (!(foundOne)){
if (obj.innerHTML.indexOf(“Please select a mailing-list to subscribe to.”)==-1) {
obj.innerHTML +=”
“;
}
return false;
}
//check if we are using IE
try
{
xmlhttp=new XMLHttpRequest();
} catch (e)
{
try
{
// if IE
Mailing Lists
//
The Conduit
The Wire Weekly
Subscribe Unsubscribe
DJ Stingray unedited
- Issue #314 (Apr 10) | In Writing
- By: Derek Walmsley | Featuring: DJ Stingray
- Links: DJ Stingray on MySpace
- Printable version
