Re: PHP and JavaScript

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> It works with HTML without body

Technically, both html and body tag pairs are optional, but it make your
page clearer to understand when included.

First thing I'd suggest is NOT using echo. As far as I can see you have
no dynamic content being produced, so put the whole lot before the "<?php"
tag.

If you must use echo then do it like this:

<?php
echo <<<END
<SCRIPT TYPE="TEXT/JAVASCRIPT" LANGUAGE=JAVASCRIPT>
  <!-- Hide script from older browsers
    function toggleMenu(currMenu) {
   if (document.all) {
    thisMenu = eval("document.all." + currMenu + ".style")
    if (thisMenu.display == "block") {
     thisMenu.display = "none"
    }
    else {
     thisMenu.display = "block"
    }
    return false
   }
   else {
    return true
   }
  }
    // End hiding script -->
 </SCRIPT>
 <STYLE TYPE="TEXT/CSS">
  #menu1 {display:none; margin-left:20px}
   </STYLE>
  <H3>
 <A HREF='page1.html' onClick='return toggleMenu("menu1")'>Update The Record</A>
</H3>
<SPAN ID='menu1'>
 <FORM>
    <P>
    <TEXTAREA name='hetext' rows='10' cols='40'>
      Update the record
    </TEXTAREA>
    <INPUT type='submit' value='Update'><INPUT type='reset'>
    </P>
 </FORM>
</SPAN>
END;
?>

Tested and works on Opera


Niel

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux