in reply to Re: Re: LWP multi-form POST
in thread LWP multi-form POST

document.foo.submit();

Yeah, that much I'm familiar with; I've personally seen examples of sites that use scripts to submit forms. This is no problem for scripting, because instead of executing the script you just submit the form. Sometimes the script does some other things before it submits the form, such as changes some field values. In that case, you just do that first, then submit the form.

However, it can be extended by creating a class of functions to submit multiple forms at the same time.

That's what I haven't seen and wouldn't know how to do. (How do you stop your script from ceasing to execute when the first form is submitted? Or is Javascript multithreaded these days? Where do the extra result pages go, then? Do they pop up in extra windows, or what?) Anyway, that's some pretty weird stuff, submitting multiple forms at once. Sites ought not to do such things. Sometimes I wish LiveScript had never been developed.


$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/

Replies are listed 'Best First'.
Re: Re: LWP multi-form POST
by Vautrin (Hermit) on Feb 11, 2004 at 16:05 UTC
    There are probably a thousand different ways to manage it depending on what exactly you are trying to do. Javascript can open up windows and control the windows. So you can open a window, submit several forms there, and close it -- or even submit the last form there. You can also use some black magic on the server side, or a thousand other things. Go to Expedia.com and walk through the javascript it takes you to get to the "My Profile" link for an example. It doesn't submit any forms, but (perhaps to foil spiders) sets cookies and then does a document.location = newURL to jump from page to page. Things like this aren't common, but they are out there to spoil spiders on sites that have a reason to not want their sites spidered -- i.e. ebay, paypal, similar sites.


    Want to support the EFF and FSF by buying cool stuff? Click here.