beating a dead horse: automated form submission
Steve Holden
sholden at holdenweb.com
Wed Jan 29 15:32:49 EST 2003
"Peter Hansen" <peter at engcorp.com> wrote in message
news:3E371BC2.BC18A93 at engcorp.com...
> Whit Whitfield wrote:
> >
> > Ok, so I at least got past step 1 -- apparently my WinPython was setup
> > incorrectly because the code snippet above worked in Idle and on my
> > unix version of Python also. (I assume that getting '200 OK' back
> > from musical
> > means it worked.
> > Now my only question is this: I've scoped out the forms that I need
> > to automate and have all the name-data pairs, but do I need to do
> > anything special for the Submit button? Or does posting the data
> > automatically start the server-side onSubmit actions? Thanks for your
> > help everyone!
>
> It's up to the receiving server what is done with the Submit button
> information. In many cases, it is checked to see that it equals the
> value specified in the form, and without that the input is not processed.
> Basically, since you can't be sure, you should either test it (and if
> you don't need it, then you don't need it), or just look in the form
> and make sure you include a key/value pair in your data that matches
> whatever the Submit button would actually do.
>
What Peter is trying to say here is that, besides the *client-side* action
of causing the form to be submitted, the button also appears in the POST
data stream as a type=value pair, and therefore you should include a
dictionary entry for it in your name-data pairs.
In terms of your question, yes, submitting the data triggers the server-side
actions that process it.
regards
--
Steve Holden http://www.holdenweb.com/
Python Web Programming http://pydish.holdenweb.com/pwp/
Bring your musical instrument to PyCon! http://www.python.org/pycon/
More information about the Python-list
mailing list