Embperl::Form::Control::scriptcode - A control to add script code to an Embperl Form


Embperl documentation Contained in the Embperl distribution.

Index


Code Index:

NAME

Top

Embperl::Form::Control::scriptcode - A control to add script code to an Embperl Form

SYNOPSIS

Top

  { 
  type   => 'scriptcode',
  code   => 'function onEvent { .... }',
  }

DESCRIPTION

Top

Used to create a script code blockinside an Embperl Form. The code block is added to the end of the form. See Embperl::Form on how to specify parameters.

PARAMETER

type

Needs to be set to 'scriptcode'.

name

optional

scripttype

Type of script code. Default: text/javascript

code

The actual script code.

Author

Top

G. Richter (richter@dev.ecos.de), A. Beckert (beckert@ecos.de)

See Also

Top

perl(1), Embperl, Embperl::Form


Embperl documentation Contained in the Embperl distribution.

###################################################################################
#
#   Embperl - Copyright (c) 1997-2010 Gerald Richter / ecos gmbh   www.ecos.de
#
#   You may distribute under the terms of either the GNU General Public
#   License or the Artistic License, as specified in the Perl README file.
#
#   THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
#   IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
#   WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
#   $Id$
#
###################################################################################

package Embperl::Form::Control::scriptcode ;

use strict ;
use base 'Embperl::Form::Control' ;

use Embperl::Inline ;

sub noframe { return 1; }

# ---------------------------------------------------------------------------
#
#   is_hidden - returns true if this is a hidden control
#

sub is_hidden

    {
    my ($self, $req) = @_ ;

    return  1 ;
    }



1 ;

__EMBPERL__

[# ---------------------------------------------------------------------------
#
#   show_control - output the control
#]

[$ sub show ($self, $req)

my $name = $self -> {name};
my $type = $self -> {scripttype} || 'text/javascript' ;

$]
<script type="[+ $type +]">
//<!--
[+ do { local $escmode = 0 ; $self -> {code} } +]
//-->
</script>
[$endsub$]

__END__