in reply to Re^3: how can i retrieve fields name from a form with mechanize
in thread how can i retrieve fields name from a form with mechanize

i have to retrieve 2 fields name from a form that contains lot of fields. i can retrieve all form fields name : my @inputsname = $forms->param; can you help me plz im blocked.
  • Comment on Re^4: how can i retrieve fields name from a form with mechanize

Replies are listed 'Best First'.
Re^5: how can i retrieve fields name from a form with mechanize
by ikegami (Patriarch) on May 13, 2009 at 19:16 UTC
    Do you want me to pick two fields at random?
    use List::Util qw( shuffle ); my ($name1, $name2) = shuffle @inputsname;

    If not, you'll need to specify what's special about those two fields, what sets them apart.

      no i dont want to retrieve 2 fields at random,i want just to retrieve the field name of login and password.and the form contain different fields name... how can i do that plzz

        Imagine a parking lot full of cars. I ask of you, "Give me the plate number of Millie's car." You can't. I didn't give you enough information.

        Repeating yourself doesn't help. You didn't answer my question. What distinguishes the login field from the others? What distinguishes the password field from the others?

        There is such as a thing as a password field, so that might be easy to guess, but there's no such thing as a login field as far as the browser is concerned. You need to tell us what makes the login field the login field because right now, the definition is entirely in your mind.