developer has asked for the wisdom of the Perl Monks concerning the following question:

Hello: I am using HTML::FORM to get all the form elements. The URL I go to has Input names as the same name from multiple fields. For example there are 4 date fields called FDATE. When I use the HTML::FORM to view the fields it display FDATE only once.

The question is How do I get all the FDATE fields and How do I update each one with different dates?. Here is my code to get the name and values.

use LWP::UserAgent; use HTML::Form; my $ua = LWP::UserAgent->new; my $response = $ua->get("http://www.hellp.com/test.exe"); my @forms = HTML::Form->parse($response->content, $response->base); foreach $form(@forms) { @names = $form->param; foreach $name(@names) { @values = $form->param( $name ); foreach $values(@values) { print "Name:$name Value of:$values \n"; } } #print "$form \n"; }
Thanks for your help in advance.

Edit by castaway - added code tags

Replies are listed 'Best First'.
Re: HTML::Form question
by NovMonk (Chaplain) on Mar 12, 2004 at 17:10 UTC
    Greetings,

    I think it would help you to read this. If we can't read your post, we can't help you. After you've tried using some formatting, use the preview button before you create, to see if it is readable.

    Don't feel too bad-- I made this mistake in my first "anonymous monk" post, myself. But as you've posted 3 times now, maybe a foray into posting syntax would serve you as well as working out your Perl syntax.

    Pax,

    NovMonk

      Pax:
      Hi I am sorry if I did post my request several times
      I am new to perl, I have been using it for past 3 months on and off
      Can you please tell me what's wrong with the syntax of my perl script.
      Your advise will be taken.
      I also hope I formtted the Message Properly.
      Thanks
        Sorry, can't help you there.

        I can only tell you when your habit is on backwards, or you're singing off key at Compline, or your belt's not tied properly.

        It's frustrating when you have an urgent question, but trust me-- if you click on "Need Help?" and read all the nodes on how (not) to ask a question-- you will be much further along the path of enlightenment that you seek. After all, 9/10 of learning is not about answers, but learning how to ask the right Questions.

        Good luck,

        NovMonk

Re: HTML::Form question
by Theo (Priest) on Mar 12, 2004 at 17:27 UTC
    If the form itself has 4 fields with the name FDATE, I don't see any possibility of getting back all the values.

    Is there a chance you can change the form?

    -Theo-
    (so many nodes and so little time ... )