LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 2010, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 8 Oct 2010 06:18:33 -0400
Reply-To:     Abebe Gashaw <abebegashaw033@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Abebe Gashaw <abebegashaw033@GMAIL.COM>
Subject:      Having problem inserting JavaScript into SAS INTRNET CGI program.
Content-Type: text/plain; charset=ISO-8859-1

<SAS-L@listserv.vt.edu> Hi Folks, I am trying to use some JavaScript in my SAS INTRNET program. Some how it is not working because somewhere else, I am making some quotation errors when I call the JavaScript function. The SAS program looks like the following: %macro runjavs; data _Null_; set IO end=last2; file _webout; put '<HTML>'; put ' <head> <script type="text/javascript"> <!--'; put 'SRC="http://ServerName/Topdir/dataloc_cmi.js">'<http://servername/Topdir/dataloc_cmi.js%22%3E'> ; put '</script> </head> <body>';

if _N_ = 1 then do; Put '<Form Action="' "&_url" '" Method=Post>'; put "<input type=hidden Name=_service" " Value=&_service> "; Put '<INPUT TYPE=hidden NAME=_debug VALUE="0"> ';

put '<INPUT TYPE="hidden" NAME="_server" VALUE="' "&_SERVER" '">'; put '<INPUT TYPE="hidden" NAME="_port" VALUE="' "&_PORT" '">'; put '<INPUT TYPE="hidden" NAME="_sessionid" VALUE="' "&_SESSIONID" '">'; put "<input type=hidden name=login Value=&LOGIN >"; put "<input type=hidden name=nobs Value=&nobs >"; Put "<input type=hidden Name=_program " "Value=Accounting1.add_drp_up_verfy_Dev.sas>"; end; if _N_ = 1 then do; put "<table width='100%' border='3' align='center' cellpadding=1 cellspacing=1 bgcolor=#FFCCCC>"; Put '<TR valign=top> <TD align="center"> <h1> <B>please select CMI from the following option</h1> </B> '; put '<input type="radio" name="DCC_CMI" '; put ' onClick="hideAll(); changeDiv("'atlanta'","'block'");">ATLANTA'; put' <div id="atlanta" style="margin-left:30px;display:none;">'; put '<B><Font color=#000000>Select CMI </Font> </B>'; put '<input type="radio" name="Response" value="45_00">00-CATI <input type="radio" name="Response" value="45_10">10-PERM CATI'; put '<input type="radio" name="Response" value="45_13">13-FAX <input type="radio" name="Response" value="45_18">18-MAIL <hr> </div>'; put '<input type="radio" name="DCC_CMI" '; put ' onClick="hideAll(); changeDiv("'dallas'","'block'");">DALLAS';

put' <div id="dallas" style="margin-left:30px;display:none;">'; put '<B><Font color=#000000>Select CMI </Font> </B>'; put '<input type="radio" name="Response" value="46_00">00-CATI <input type="radio" name="Response" value="46_10">10-PERM CATI'; put '<input type="radio" name="Response" value="46_13">13-FAX <input type="radio" name="Response" value="46_18">18-MAIL <hr> </div>'; put ' <input type="radio" name="DCC_CMI"'; put ' onClick="hideAll(); changeDiv("'kcdcc'","'block'");">KC'; put ' <div id="kcdcc" style="margin-left:30px;display:none;">'; put '<B><Font color=#000000>Select CMI </Font> </B>'; put '<input type="radio" name="Response" value="47_00">00-CATI <input type="radio" name="Response" value="47_10">10-PERM CATI'; put '<input type="radio" name="Response" value="47_13">13-FAX <input type="radio" name="Response" value="47_18">18-MAIL <hr> </div>'; Put "<input type=submit Value=SUBMIT>"; Put "<input type=Reset Value=RESET>"; Put '</form>'; put '</Body>'; Put '</Html>'; end; run; %mend; %runjavs /** The javaScript looks like the following ***/ <script type="text/javascript"> <!-- function changeDiv(the_div,the_change) { var the_style = getStyleObject(the_div); if (the_style != false) { the_style.display = the_change; } }

function hideAll() { changeDiv("atlanta","none"); changeDiv("dallas","none"); changeDiv("kcdcc","none"); } function getStyleObject(objectId) { if (document.getElementById && document.getElementById(objectId)) { return document.getElementById(objectId).style; } else if (document.all && document.all(objectId)) { return document.all(objectId).style; } else { return false; } } // --> </script> /*** This this the way I call the java functions ***/ put '<input type="radio" name="DCC_CMI" '; put ' onClick="hideAll(); changeDiv("'atlanta'","'block'");">ATLANTA'; put' <div id="atlanta" style="margin-left:30px;display:none;">'; put '<B><Font color=#000000>Select CMI </Font> </B>'; put '<input type="radio" name="Response" value="45_00">00-CATI <input type="radio" name="Response" value="45_10">10-PERM CATI'; put '<input type="radio" name="Response" value="45_13">13-FAX <input type="radio" name="Response" value="45_18">18-MAIL <hr> </div>'; /*** what is wrong with this java function call? *****/ Thank you in advance


Back to: Top of message | Previous page | Main SAS-L page