It says s is null on line 37
here's the code I have...
Code:// JavaScript Document selectIDs=['companyName','sloganS','nameS','titleS','address1S','address2S','phoneS','cellS','emailS','websiteS']; function attachBehaviors() { // Attach event handler to your select objects for (i=0 ; i<selectIDs.length ; i++){ var s = document.getElementById("select_"+selectIDs[i]); if( s ) { s.onchange = function(){selectCallback(s,selectIDs[i]);}; } } } fontData=[]; fontData[443]='Arial'; fontData[444]='Book Antiqua Italic'; fontData[445]='Bradley Hand ITC'; fontData[446]='Century Gothic'; fontData[447]='Comic Sans MS'; fontData[448]='Copperplate Gothic Bold'; fontData[449]='Courier'; fontData[461]='edwardian script ITC'; fontData[462]='Garamond'; fontData[463]='Georgia'; fontData[464]='Haettenschweiler'; fontData[482]='Helvetica'; fontData[483]='Impact'; fontData[484]='Lucida Handwriting'; fontData[485]='Monotype Corsiva'; fontData[486]='Tahoma'; fontData[487]='Times New Roman'; fontData[488]='Trebuchet MS'; fontData[489]='Verdana'; function selectCallback(s,changevar) { // This function gets called when selection changes if( s.selectedIndex == -1 ) return; var v = s.options[s.selectedIndex].value; var theobjtoChange=document.getElementById(changevar); theobjtoChange.style.fontFamily=fontData[v]; } window.onload = attachBehaviors;


LinkBack URL
About LinkBacks

Reply With Quote