Dynamic FORM names

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I've been wondering for a while if it is possible to have dynamic form
To make it clear, I've used common parse_form subroutines and then read form
        $form_input = "$FORM";
Now, when I have manymany checkboxes in my form I need to write every
form_name manually because the code above doesn't quite accept variables as
        $form_input = "$FORM";
no matter whether I use " '' " or not.
I would appreciate a solution for this problem. At the moment I'd like to
think that it lies in the parse_form subroutine...?

Re: Dynamic FORM names

Juhani Elbanvetäjä wrote:
Quoted text here. Click to load it

Yes, of course.

Quoted text here. Click to load it

Exactly what do you mean by "doesn't quite accept"? Whatever you mean, I
find it hard to believe that you can't access a hash value while
specifying the key as a variable.

     our %FORM = ( somename => 'somevalue' );
     my $form_name = 'somename';
     my $form_input = $FORM;
     print "$form_input\n";


Accordingly, I'd guess that you are making some other mistake.

Please study the posting guidelines for this group:

Doing so you'll see that in order to increase your chances to get help,
you are recommended to post a short but complete program that others can
copy and run and that demonstrates the problem you are having.

Quoted text here. Click to load it

If that's actually the case, the only solution to your problem you are
likely to get here is that you'd better start using the more up-to-date
parsing routine provided by CGI.pm.

Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

Site Timeline