OK. got ya.

perl does not care about form names, AFAIK.
you can get arrays parsed out from multiple checkboxs and drop down
menus but I know of no way to get an array from each form on a page
parsed out.

build the form with a call from the script and count up on the variable
names...
pic_name1,pic_name2....
height1,height2...
width1,width2...
whatever

I take it you are reading from folders with opendir maybe?

maybe you know this, but, you can: 
loop through the folder -
select the file types you want by extension -
grab image data from the graphics -
put the data into variables and parse a template substituting the
variables into form inputs -

or better yet

loop through the folder -
select the file types you want by extension -
display thumbs associated with checkboxs all with the same name, this
will allow multiple selects -
the parsed output by the script will give you an array of file names to
build your edit form with -

then for example...with the height width tag have a check box named
maintain_aspect_ratio, when checked they enter a number used as a
percentage and you can return a nicely scaled image -

a hidden input form tag is:
<input type=hidden name=my_hidden_variable value=my_hidden_value>
you can use these keep state or to tell the script what to do with the
data...
<input type=text name=id_number value="" size=4>
<input type=password name=password value="" size=12>
<input type=hidden name=action value=delete>
..
this is an example of passing to a form and using from a form with
cgi.pm and a hidden variable.

#!/usr/bin/perl -w

use CGI qw/:standard :html3/;;  #leave the double statement
                                #line ending alone here
use strict;

my $query=new CGI;

unless ($query->param)
{&build_form;}
else
{&delete_some_poor_slob;}


sub delete_some_poor_slob
{
my $action=$query->param('action');
my $id_number=$query->param('id_number');
my $password=$query->param('password');
                                #we dont really do anything here
                                #just for example
print $query->header;
print $query->start_html;
print "<p><h1>FINISHED!</h1>";
print $query->end_html
exit(0);
}

sub build_form
{
print $query->header;
print $query->start_html;
print "<p><center>\n";
print qq!<table border=0 bgcolor="#c0c0c0" cellpadding=5
cellspacing=0>\n!;
#
# note use of qq! above...compare with other lines that contain quoted
# attrtibutes
# 
#
print $query->start_form,"\n";
###
print "<tr>\n";
print "<td align=\"right\">\n";
print "ID Number:\n";
print "</td>\n";
print "<td>\n";
print $query->textfield(-name=>'id_number',
            -size=>4);
print "</td>\n";
print "</tr>\n";
###
print "<tr>\n";
print "<td align=\"right\">\n";
print "Password:\n";
print "</td>\n";
print "<td>\n";
print $query->password_field(-name=>'password',
            -size=>12);
print "</td>\n";
print "</tr>\n";
###
print "<tr>\n";
print "<td colspan=2 align=\"center\">\n";
print "<hr noshade size=1>\n";
print $query->submit(-label=>'Delete',
          -value=>'Submit'),"\n";
print "</td>\n";
print "</tr>\n";
print $query->end_form,"\n";
print "</table>\n";
print "</center>\n";
print $query->hidden(-name=>'action',
                -value=>'delete');
print $query->end_html;
exit(0);
}
######END SCRIPT########


On Wed, 16 Oct 2002 22:50:21 -0400
Joel Hammer <[EMAIL PROTECTED]> wrote:

>I care about telling the script which form is submitted because I have
>an html page with up to 36 identical forms, each form referencing a
>separate object (an image). I am concocting a home brew image editing
>GUI using opera, or any browser. So, each image is loaded on the page,
>and certain editing functions can be done on each image using the
>image's own form. I have to use CGI instead of javascript because this
>will involve writing to a file which, I believe, is not possible in
>javascript. 
>
>The only things I can see to pass are values returned by certain input
>objects, like select and text.  Could you give me an example of a
>hidden tag that gets passed when a form is submitted?
>
>T
_______________________________________________
Linux-users mailing list
[EMAIL PROTECTED]
Unsubscribe/Suspend/Etc -> http://www.linux-sxs.org/mailman/listinfo/linux-users

Reply via email to