onClickevent handler can be used to control many aspects of form submission. For example, the following code might be used to submit the same form data to two different servers:
In this example, before each invocation of the form's
actionproperty is defined so that each call to the
submitmethod sends the query data to a different server. Similarly, the
targetproperty is configured so that the the servers' responses are shown in separate frames. This event handler code returns a
falseis explicitly returned.) Of course, we could also have omitted both the second
submitcall and the
returnstatement to achieve the same result.)
Internet Explorer 3.0 fails because it does not support assignment to the
target properties. On the other hand, Netscape Navigator 3.0 supports the assignment, but does not properly handle multiple calls to the
submit method. The reason for this is that Netscape does not actually issue the HTTP request until after the interpreter has returned from the event handler. As a result, on Netscape only the last in a series of calls to the submit method works correctly.
Not all is lost. There are probably many ways to work around this problem. For example, if you have any control over the contents returned by the servers you are querying, then you might be able to include an
onLoad event handler with the first server's response, so that when it is loaded, it resubmits the form to the second server. This is a rather difficult kludge, but it is definitely possible.