// // Date: 09/06/2009 // Desc: Suscribe Functions for validating and subscribing. // function f_subscribe(httpRequest) { try { if (httpRequest.readyState == 4) { if (httpRequest.status == 200) { alert(httpRequest.responseText); } else { alert('There was a problem with the request. Please Try again.'); } btn = document.getElementById('enews-subscribe-submit') ; btn.disabled = false ; btn.value = "Subscribe" ; } } catch( e ) { alert('Unable to process subscribe: ' + e.description); } } function f_subscribe_check(as_book, as_linked, as_form_type) { var c, n, e, b, r, btn, frm, i_book, i_checked ; var s_list = "", s_list_desc = ""; var s_ihtml; if (as_form_type == null) { as_form_type = ''; } frm = document.getElementById('enews-subscribe-form-' + as_book) ; i_book = 0 ; i_checked = 0 ; do { e = document.getElementById('enews-subscribe-book-input-' + as_book + i_book) ; if (e != null) { if (e.checked) { i_checked++; s_list += e.value + ","; ed = document.getElementById('enews-subscribe-book-label-' + as_book + i_book); s_ihtml = ed.innerHTML; s_ihtml = s_ihtml.replace('<', '<'); s_ihtml = s_ihtml.replace('>', '>'); s_ihtml = s_ihtml.replace('&', '&'); s_list_desc += s_ihtml + ","; } if (e.checked == undefined && e.value != '') { /* Select box */ i_checked++; s_list += e.value + ","; /* Find selected option desc */ for (var ib = 0; ib < e.options.length; ib++) { ed = document.getElementById('enews-subscribe-book-label-' + as_book + ib); if (ed.getAttribute('value') == e.value) { break; } } s_ihtml = ed.innerHTML; s_ihtml = s_ihtml.replace('<', '<'); s_ihtml = s_ihtml.replace('>', '>'); s_ihtml = s_ihtml.replace('&', '&'); s_list_desc += s_ihtml + ","; } i_book++; } else { if (i_book == 0) { i_checked = -1; } } } while (e != null) ; if (i_checked == 0) { alert('Please select at least one list.') ; return false ; } if (i_checked > 0) { n = document.getElementById('enews-subscribe-list'); n.value = s_list; nd = document.getElementById('enews-subscribe-list-desc') ; nd.value = s_list_desc ; } n = document.getElementById('enews-subscribe-name-input-' + as_book); if (n.value == '') { alert('Please enter a name.'); frm.enews_subscribe_name.focus(); return false; } let nl = n.value.toLowerCase(); if (nl.indexOf('www') >= 0 || nl.indexOf('http') >= 0 || nl.indexOf('https') >= 0|| nl.indexOf('//') >= 0) { alert('Please enter a valid name.'); frm.enews_subscribe_name.focus(); return false; } e = document.getElementById('enews-subscribe-email-input-' + as_book); if (e.value == '') { alert('Please enter an email address.'); frm.enews_subscribe_email.focus(); return false; } if (as_form_type.indexOf('|SN|') >= 0) { sn = document.getElementById('enews-subscribe-student-name-input-' + as_book); if (sn != null) { if (sn.value == '') { alert('Please enter a student name.'); frm.enews_subscribe_student_name.focus(); return false; } } sy = document.getElementById('enews-subscribe-student-year-input-' + as_book); if (sy != null) { if (sy.value == '') { alert('Please enter a student year.'); frm.enews_subscribe_student_year.focus(); return false; } } } if (as_linked == 'Y') { cust = document.getElementById('enews-subscribe-cust-input-' + as_book); if (cust.value == '') { alert('Please choose center.'); frm.enews_subscribe_cust.focus(); return false; } } if (window.location.protocol == 'https:') { frm.action = "https://buildsend.com/ws/1.0/subscribe.aspx"; } else { frm.action = "http://buildsend.com/ws/subscribe.aspx"; } //frm.action = "http://localhost:50042/subscribe.aspx" ; frm.submit(); } document.write('') document.write('
List:
Name:
Email:


Powered by School Enews
')