Re: Re: Partially display form elements
| From: | brian | Date: | Mon, 02 Jan 2006 16:28:30 +0000 |
| Subject: | Re: Re: Partially display form elements | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-22406@lists.php.net to get a copy of this message | ||
Ignatius Reilly wrote:
// The javascript showing/ hiding a "block" (set of contiguous rows)
$js = <<<JS
<script language='javascript'>
//<![CDATA[
function switch_block( b ) {
block = "block[" + b + "]" ;
if ( document.getElementById( block ).style.display == 'none' ) {
document.getElementById( block ).style.display = 'block' ;
} else {
document.getElementById( block ).style.display = 'none' ;
} }
//]]>
</script>
JS;
echo $js;
Why create a variable to hold all of that? PHP will simply echo that out if you close your PHP tag first.
brian