logo       

Re: Help, Please: Can't Get a Hold of <input type=button ...>: msg#00021

lang.perl.modules.lwp

Subject: Re: Help, Please: Can't Get a Hold of <input type=button ...>

On Wed, 8 Sep 2004, Daniel E. Doherty wrote:

> I hit a page on the FDIC website that allows me to download Bank
> Performance Reports, so-called "Call Reports." I can fill in the fields
> on the page, but the button that kicks off the file transfer is
> generated by an HTML tag like this:
>
> <input type="button" value="Export" onclick="FormSubmit(this.form);">
[...]
> Is this right? I'm no HTML expert, but my 1998 O'Reilly book on HTML,
> covering HTML 4.0 states that <input type="button" ...> is a synonym for
> <button ...>.

No, they're not synonymous. Quoting from my FAQ on my Python module based
on HTML::Forms (see second bullet point -- your callback JavaScript
function is FormSubmit()):

http://wwwsearch.sourceforge.net/ClientForm/#faq

Why does .click()ing on a button not work for me?

- Clicking on a RESET button doesn't do anything, by design - this is a
library for web automation, not an interactive browser. Even in an
interactive browser, clicking on RESET sends nothing to the server, so
there is little point in having .click() do anything special here.

- Clicking on a BUTTON TYPE=BUTTON doesn't do anything either, also by
design. This time, the reason is that that BUTTON is only in the HTML
standard so that one can attach callbacks to its events. The callbacks are
functions in SCRIPT elements (such as Javascript) embedded in the HTML,
and their execution may result in information getting sent back to the
server. ClientForm, however, knows nothing about these callbacks, so it
can't do anything useful with a click on a BUTTON whose type is BUTTON.

- Generally, embedded script may be messing things up in all kinds of ways.
See the answer to the next question.


John



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise