Click to See Complete Forum and Search --> : Extracting All Form Element names from a large form.


surge42
05-18-2004, 01:11 PM
What's up guys?

I've just built one massive html form for a client and now its time to set up the back end for it.

I have to go into each form element and copy the name of the fields so that I can tell the Perl script what to do with them.

Is there a application that can extract all the field names from a HTML form automatically?

Thanks for the help!
Scott West Chester PA

CyCo
05-18-2004, 01:19 PM
...this can easily be done in your Perl script...

surge42
05-18-2004, 01:53 PM
Hugh?

How can my Perl script extract the names of my form objects.

Are you telling me that there is a perl script out there that will pars this info for me automatically and return just the object names?

CyCo
05-18-2004, 02:09 PM
yes...it's quite simple...


#!/usr/bin/perl

use strict;
use CGI qw/:standard/;

my ($key,@values);

print header,
start_html('Form Results'),
h3('Form Results');
foreach $key(param) {
@values = param($key);
print $key.': ',
join(', ',@values),
br;
}
print end_html;


this will parse every form element and display the name of the field and the corresponding field data....if all you want is the "field", then just eliminate the join(', ',@values), line

surge42
05-18-2004, 02:42 PM
CyCo

YOU ARE THE MAN!

thanks man....

CyCo
05-18-2004, 02:51 PM
you're welcome...
now, how about that other post in the Perl forum..?

surge42
05-18-2004, 05:19 PM
Ok, I posted a reply to the Perl forums.

Thanks again.