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

I have a web page without form in it, but it has input fields(email address, password). When the page loaded, it doesn't focus on these fields, so I can't set these fields current because I can't find the form I need to set as current. The part of the source code of the web page like this:
<label id="email_address_label" for="email_address"> Email Address: </label> <input id="email_address_input" name="email_address" type="text" />
<label id="password_label" for="password"> Create a Password: </label> <input id="password_input" name="password" type="password" />
I couldn't find any "<form>" clause in the whole web page source code. Can anyone help?
  • Comment on fill a web page without form using Mechanize module

Replies are listed 'Best First'.
Re: fill a web page without form using Mechanize module
by ww (Archbishop) on Feb 07, 2011 at 22:58 UTC
    This smells like an .html question... or maybe an issue complicated by .js or flash... in any of which cases, this is the wrong forum. Nonetheless, some questions and suggestions about seeking help.

    Initially, your phrasing suggests that the web page is yours; that is, presumtively, created by you. But your final statement suggests you viewed the source (in a browser?) and failed to find any form tag (did you find a submit? Please clarify... and if you used Perl in some manner to ascertain what you assert, please provide the code.

    Next, please consult Markup in the Monastery,On asking for help and I know what I mean. Why don't you?. Then, update your OP with the relevant detail and formatting. As is, your question is basicly unanswerable; with the relevant detail, there may be some chance we can help.

Re: fill a web page without form using Mechanize module
by ikegami (Patriarch) on Feb 07, 2011 at 22:49 UTC

    I have a web page without form in it, but it has input fields(email address, password).

    Why do you want to fill out fields you can't submit? The FORM element specifies the url to which the fields are to be submitted. This isn't just theoretical. I tested a submit button outside of a FORM, and clicking it did nothing in FireFox. It could be that the fields are being used by JavaScript, but WWW::Mechanize doesn't process JavaScript.

    PS - Just in case you care to know, it's actually illegal to have INPUT elements outside of a FORM element in HTML.