i think you have to add "\n" after each row of java script code. .... $js .= "}\n";
mfg. harry wiens "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> schrieb im Newsbeitrag news:[EMAIL PROTECTED] How can I get a script to work on a page that has HTML generated by PHP and a javascript with functions called by an checkbox? javascript: function PrintScript(){ $js = "function CheckBox1()"; $js .= "{var box1 = window.document.ctype.wr;var box2 = window.document.ctype.pfo;var box3 = window.document.ctype.pr;"; $js .= "if (box1.checked == true ) {box2.checked = false;box3.checked = false;}"; $js .= "}"; $js .= "function CheckBox2(){var box1 = window.document.ctype.wr;var box2 = window.document.ctype.pfo;var box3 = window.document.ctype.pr;"; $js .= "if (box2.checked == true ) {box1.checked = false;box3.checked = false;}"; $js .= "}"; $js .= "function CheckBox3(){var box1 = window.document.ctype.wr;var box2 = window.document.ctype.pfo;var box3 = window.document.ctype.pr;"; $js .= "if (box3.checked == true ) {box1.checked = false;box2.checked = false;}}"; return $js; }//end function This function is called by a Display() function and here is the final out put in HTML: <head> <title> Independent Fact Finders Inc. </title> <meta name="description" content="Independent Fact Finders Inc."> <META name="keywords" content="Legal, background checks, background, check, records, paralegal, lawyer, attorney"> <meta name="allow-search" content="yes"> <meta name="audience" content="all"> <meta name="robots" content="all, index, follow"> <meta name="revisit-after" content="14 days"> <meta name="Rating" content="General"> <meta name="Language" content="en"> <meta name="distribution" content="Global"> <meta name="Classification" content="Legal"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="stylesheet" href="iffinet.css" type="text/css" /> <script>function CheckBox1(){var box1 = window.document.ctype.wr;var box2 = window.document.ctype.pfo;var box3 = window.document.ctype.pr;if (box1.checked == true ) {box2.checked = false;box3.checked = false;}}function CheckBox2(){var box1 = window.document.ctype.wr;var box2 = window.document.ctype.pfo;var box3 = window.document.ctype.pr;if (box2.checked == true ) {box1.checked = false;box3.checked = false;}}function CheckBox3(){var box1 = window.document.ctype.wr;var box2 = window.document.ctype.pfo;var box3 = window.document.ctype.pr;if (box3.checked == true ) {box1.checked = false;box2.checked = false;}}</script></head> <body TOPMARGIN=0 LEFTMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0> <table width="100%" align="center" cellpadding="0" cellspacing="0"> <tr nowrap> <td class="tdHorHeader" width="100%" align="center" valign="middle"></h1><strong> iffinet.com</h1></strong> </td> </tr> </table> <div align="center"> <table cellpadding="0" cellspacing="1" width="712" align="middle" valign="top"><table width="712" height="211" border="0" cellpadding="10" cellspacing="5"> <tr> <td class="tdtop" width="230" height="205" align="right" valign="middle"></td> <td class="tdtop" width="230" height="205" align="center" valign="middle"></td> <td class="tdtop" width="230" height="205" valign="middle"><h1> Independent Fact Finders Inc. </h1> <h2> Our site, Iffinet.com, is currently under construction. We will be operational soon. </h2> </td> </tr> </table> <table width="100%" bgcolor="#660000" align="center" cellspacing="1" cellpadding="2"> <tr><td> <form name="crimetype" method="post" action=""> <input type="checkbox" name="WR" value="1" onClick="return CheckBox1();"> <input type="checkbox" name="PFO" value="2" onClick="return CheckBox2();"> <input type="checkbox" name="PR" value="3" onClick="return CheckBox3();"></form></td> <td>1</td> <td>1</td> <td>Tim</td> <td>C</td> <td>Best</td> <td>1972-10-02</td> <td>1111 fb</td> <td>NOLA</td> <td>LA</td> <td>70114</td> <td>0</td> <td>happy to be here</td> <td>0</td> </tr> <tr><td> <form name="crimetype" method="post" action=""> <input type="checkbox" name="WR" value="1" onClick="return CheckBox1();"> <input type="checkbox" name="PFO" value="2" onClick="return CheckBox2();"> <input type="checkbox" name="PR" value="3" onClick="return CheckBox3();"></form></td> <td>2</td> <td>1</td> <td>Molly</td> <td>M</td> <td>Best</td> <td>0000-00-00</td> <td></td> <td></td> <td></td> <td>0</td> <td>0</td> <td></td> <td>0</td> </tr> </table></table></div><table width="100%" align="center" cellpadding="0" cellspacing="0"> <tr nowrap> <td class="tdHorHeader" width="100%" valign="bottom" align="right"><p class="maintext">Site Development and Graphic Design by <a class="maintext" href="http://www.best-it.biz" target="_blank">Best IT</a></p> </td> </tr> </table> </body> </html> This doesnąt work but it illustrates what I would like to do (a little)... /T -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php