f



Need Help Extracting Form Names From A Form (its a damn big form and I was hoping to do it automatically)

I have a form that will output to a flat file when the submit button
is pushed.

As you can probably guess every form object must have a name because
the Perl script has to know how to append the form object info to the
flat file.

My problem is that the form I've created is HUGE.  Manually copying
and pasting these form names is going to take me a very very long
time.

Is there a web page or application out there that can automatically
extract the form names from a form in a html document?

There's got to be a program out there that can do this!

Thanks for your help.



----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
0
Scott_From_PA
5/18/2004 6:39:52 PM
comp.authoring.html 7078 articles. 0 followers. Post Follow

2 Replies
595 Views

Similar Articles

[PageSpeed] 55

In article <hdlka0l5duh5lqdp4rkrbg70hdjuu2r631@4ax.com>, 
sorry_I_dont_need_spam@noway.com enlightened us with...
> I have a form that will output to a flat file when the submit button
> is pushed.
> 
> As you can probably guess every form object must have a name because
> the Perl script has to know how to append the form object info to the
> flat file.
> 
> My problem is that the form I've created is HUGE.  Manually copying
> and pasting these form names is going to take me a very very long
> time.
> 
> Is there a web page or application out there that can automatically
> extract the form names from a form in a html document?
> 
> There's got to be a program out there that can do this!
> 
> Thanks for your help.

Why don't you just run a quick javascript to grab the names and output 
them for copy/paste?

In the html of the page in question, put this script after the form on 
the bottom of the page. The names will be listed one after the other for 
copy/paste into the perl doc. Note that the elements must be named. This 
assumes there is only one form on the page and all elements are named 
uniquely (no arrays).

<script type="text/javascript">
var f = document.forms[0];
var l = f.length();
for (var i=0; i<l; i++)
   document.write(f.l.name);
</script>

Perl might have a way to get all form elements POSTed (name and value 
pairs), but I'm not very good at Perl. I know I can do it in JSP with 
GET or POST. Anyway, good luck.

-- 
--
~kaeli~
A midget fortune teller who escapes from prison is a small 
medium at large.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

0
kaeli
5/19/2004 12:37:43 PM
On Tue, 18 May 2004 14:39:52 -0400, Scott_From_PA wrote:

> I have a form that will output to a flat file when the submit button
> is pushed.
> 
> As you can probably guess every form object must have a name because
> the Perl script has to know how to append the form object info to the
> flat file.
> 
> My problem is that the form I've created is HUGE.  Manually copying
> and pasting these form names is going to take me a very very long
> time.

#!/usr/bin/perl

use CGI qw(:standard);

my @keys = param ();

foreach ($keys) {
  # do something
}

-- 
Some say the Wired doesn't have political borders like the real world,
but there are far too many nonsense-spouting anarchists or idiots who
think that pranks are a revolution. 

0
Owen
5/24/2004 11:41:38 PM
Reply: