[Seaside] tutorial1: form submit method
Nevin Pratt
nevin@smalltalkpro.com
Thu, 25 Apr 2002 23:40:25 -0600
OK, looking at the following code from the seaside tutorial1:
<form action="@convert">
<input name="@amount" type="text" size="4">
<input type="radio" name="@conversion" value="13.760300">ATS
<input type="radio" name="@conversion" value="40.3399900">BEF
<input type="radio" name="@conversion" value="1.955830">DEM
<input type="radio" name="@conversion" value="166.386000">ESP
<input type="radio" name="@conversion" value="6.559570">FRF
<input type="submit" value="Convert">
</form>
= <b>42.0 EUR</b>
The above is the string for the #html method for the SeasideTutorial
class from the tutorial. When that class/app is viewed in the browser,
it of course has a button that, when pressed, invokes the #convert
instance method in the SeasideTutorial class. Just as the tutorial says
it should.
OK, good enough.
But, what exactly happens if there was *no* action attribute specified
in the form tag above, and it is therefore just <form> rather than <form
action="@convert">? What method gets invoked then?
When I try to test this particular variation (i.e., no action attribute
at all), then press the input button in the browser, nothing happens *at
all* (that I can tell).
I've tried some judiciously placed 'self halt' statements in the Seaside
code hoping to intercept it trying to do something, but so far I've come
up empty.
So, what exactly happens when there is no action attribute specified for
the form tag?
The reason I am asking is because some server-to-server communication
conventions will try to do just that. For example, if you use the IPN
(Instant Payment Notification) server-to-server feature of PayPal, then
the PayPal server will try to invoke a URL that you have specified, with
a form filled with a bunch of hidden input fields. In other words,
PayPal will try to POST something very similar to the above html, but
without an action attribute specified. I need to know how to intercept
such a situation from within Seaside so that I can look at the hidden
fields PayPal is trying to send me.
Nevin