You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Elvis <el...@goebusiness.com> on 2001/08/04 19:08:15 UTC

2.0b3 and processing "input" fields

I can't get Embperl to "select" a dropdown list option if I import the options via Execute.


---- test.html ----

[- $dbgInput = 1 -]


<form>
        <select name="Example">
        <option value="1">One</option>
        <option value="2">Two</option>
        <option value="3">Three</option>
        </select>
</form>


<form>
        <select name="Example2">
        [- Execute('options.html') ; -]
        </select>
</form>


--- options.html (the included file ---

options.html:
        <option value="1">One</option>
        <option value="2">Two</option>
        <option value="3">Three</option>


The problem is that in Example2, the option is not selected.

If I can test.html?Example=2&Example2=2 then the first form "option 2" is selected.  However, there is no processing on Example2.

/tmp/embperl.log shows the selection of Example but there is nothing about Example2 in there...which leads me to suspect that the processing doesn't occur when you "import" the option list via an Execute statement.

Bill "Elvis" Gibbs
goEbusiness.com - putting e-motion in your business
email - elvis@goebusiness.com work - 301-668-5090 cell - 301-748-6938



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


RE: 2.0b3 and processing "input" fields

Posted by "Bill \"Elvis\" Gibbs" <el...@goebusiness.com>.
Thank you, I will try this.  Any ideas on the weird display of the foreach
loop I also sent along?

Bill "Elvis" Gibbs
goEbusiness.com - putting e-motion in your business
email - elvis@goebusiness.com work - 301-668-5090 cell - 301-748-6938

-----Original Message-----
From: Gerald Richter [mailto:richter@ecos.de]
Sent: Tuesday, August 07, 2001 2:25 AM
To: Elvis; embperl@perl.apache.org
Subject: Re: 2.0b3 and processing "input" fields




> I can't get Embperl to "select" a dropdown list option if I import the
options via Execute.
>

Yes, because Embperl 2 scans the two document independenly of each other, it
is not aware that the option tags, belongs to the select tag. I would return
an array that contains the options and display them in the main file:

         [- Execute('options.html', \@val, \@txt) ; -]

         <select name="Example2">
            <option value="[+ $val[$row] +]">[+ $txt[$row] +]</option>
         </select>

 options.html:

    [-
    @{$param[0]} = (1,2,3) ;
    @{$param[1]} = (One, Two, Three) ;
    -]

Gerald

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: 2.0b3 and processing "input" fields

Posted by Gerald Richter <ri...@ecos.de>.

> I can't get Embperl to "select" a dropdown list option if I import the
options via Execute.
>

Yes, because Embperl 2 scans the two document independenly of each other, it
is not aware that the option tags, belongs to the select tag. I would return
an array that contains the options and display them in the main file:

         [- Execute('options.html', \@val, \@txt) ; -]

         <select name="Example2">
            <option value="[+ $val[$row] +]">[+ $txt[$row] +]</option>
         </select>

 options.html:

    [-
    @{$param[0]} = (1,2,3) ;
    @{$param[1]} = (One, Two, Three) ;
    -]

Gerald

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: print OUT in 2.0b3 (was: 2.0b3 and processing "input" fields)

Posted by Gerald Richter <ri...@ecos.de>.
Sorry, I missed this the first time. It's better change the subject line if
you have a new subject :-)

>
> [* foreach my $row (@$Contacts) { *]
>         <tr>
>                 <td>
>                         <a href="">[* print OUT $row->{'Company'} ; *]</a>
>                 </td>
>                 <td>
>                         [*
>                                 print OUT $row->{'LastName'} ;
>                                 if ($row->{'FirstName'} and
$row->{'LastName'}) {
>                                         print OUT ', ' ;
>                                 }
>                                 print OUT $row->{'FirstName'} ;
>                         *]
>                 </td>
>                 <td>[* print OUT $row->{'Phone'} ; *]</td>
>                 <td>[* print OUT $row->{'Email'} ; *]</td>
>         </tr>
> [* } *]
>
> However, in 2.0b3 I get the output repeated like this (same number of
lines though
>
printing to OUT doesn't work correctly in 2.0b3. It will be fixed in 2.0b4.
Quoting README.v2 which comes with the Embperl 2 distribution:

The following things are not fully tested/working yet:
------------------------------------------------------

- [- exit -]

- safe namespaces

- print to OUT does not work correctly inside of loops


Gerald

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925131
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Re: 2.0b3 and processing "input" fields

Posted by Elvis <el...@goebusiness.com>.
I also have another problem.

This works in 1.3.3

$Contacts is an array ref to hash refs (DB output)

[* foreach my $row (@$Contacts) { *]
        <tr>
                <td>
                        <a href="">[* print OUT $row->{'Company'} ; *]</a>
                </td>
                <td>
                        [*
                                print OUT $row->{'LastName'} ;
                                if ($row->{'FirstName'} and $row->{'LastName'}) {
                                        print OUT ', ' ;
                                }
                                print OUT $row->{'FirstName'} ;
                        *]
                </td>
                <td>[* print OUT $row->{'Phone'} ; *]</td>
                <td>[* print OUT $row->{'Email'} ; *]</td>
        </tr>
[* } *]

Output:

<tr>
    <td>ABC Corp</td>
    <td>Smith, John</td>
    <td>Phone</td>
    <td>Email</td>
</tr>
<tr>
    <td>XYZ Corp</td>
    <td>Doe, John</td>
    <td>Phone</td>
    <td>Email</td>
</tr>

However, in 2.0b3 I get the output repeated like this (same number of lines though

<tr>
    <td>ABC CorpXYZ Corp</td>
    <td>Smith, JohnDoe, John</td>
    <td>PhonePhone</td>
    <td>EmailEmail</td>
</tr>
<tr>
    <td>ABC CorpXYZ Corp</td>
    <td>Smith, JohnDoe, John</td>
    <td>PhonePhone</td>
    <td>EmailEmail</td>
</tr>

In both cases, EMBPERL_OPTIONS are set to 262160.

I switched to 2.0b3 for testing because in 1.3.3 a combination of auto fill of the input/select boxes + [* *] doesn't work right (I see the [* *] in the value="" boxes, among other things but I know [* *] is experimental in 1.3 tree)

Bill "Elvis" Gibbs
goEbusiness.com - putting e-motion in your business
email - elvis@goebusiness.com work - 301-668-5090 cell - 301-748-6938

On Sat, 4 Aug 2001, Elvis wrote:

> I can't get Embperl to "select" a dropdown list option if I import the options via Execute.
> 
> 
> ---- test.html ----
> 
> [- $dbgInput = 1 -]
> 
> 
> <form>
>         <select name="Example">
>         <option value="1">One</option>
>         <option value="2">Two</option>
>         <option value="3">Three</option>
>         </select>
> </form>
> 
> 
> <form>
>         <select name="Example2">
>         [- Execute('options.html') ; -]
>         </select>
> </form>
> 
> 
> --- options.html (the included file ---
> 
> options.html:
>         <option value="1">One</option>
>         <option value="2">Two</option>
>         <option value="3">Three</option>
> 
> 
> The problem is that in Example2, the option is not selected.
> 
> If I can test.html?Example=2&Example2=2 then the first form "option 2" is selected.  However, there is no processing on Example2.
> 
> /tmp/embperl.log shows the selection of Example but there is nothing about Example2 in there...which leads me to suspect that the processing doesn't occur when you "import" the option list via an Execute statement.
> 
> Bill "Elvis" Gibbs
> goEbusiness.com - putting e-motion in your business
> email - elvis@goebusiness.com work - 301-668-5090 cell - 301-748-6938
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
> For additional commands, e-mail: embperl-help@perl.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org