in reply to (tye)Re: Form actions and browser refresh on PM
in thread Form actions and browser refresh on PM

One thing that may be easy to implement (I haven't looked at the Everything code) that would solve the problem of "which" form was submitted would be to have the parameter not named action, but action.UrlEncodedExpectedParamNames.

Then you could sublcass CGI to only read in the params you want in _init by looking at the action.something parameter. Of course, you would have to define the expected params for each form action to differentiate between params that existed in the URL as opposed to being posted. You could probably make better use of this but I think this way would be pretty easy to shoehorn in to the source.

-Lee

"To be civilized is to deny one's nature."
  • Comment on Re: (tye)Re: Form actions and browser refresh on PM

Replies are listed 'Best First'.
(tye)Re2: Form actions and browser refresh on PM
by tye (Sage) on Oct 04, 2001 at 19:08 UTC

    I think you misunderstand the problem. The challenge isn't how to ignore extra parameters that don't apply to the form being submitted (all of the forms here already know which parameters they care about and happily ignore the rest), but nearly the opposite: getting forms to preserve extra parameters so that the forms cooperate better.

    Take, for example, the scratch pad viewer. After you get there, you can enter a username and click Submit and you'll see that user's scratch pad (if possible). While looking at that scratch pad, click the Talk button in the chatter box. The screen will refresh and you won't see the selected user's scratch pad anymore. This makes it rather difficult to discuss the contents of someone's scratch pad with them (without resorting to a separate window for chat).

    The problem is that the first submit adds a "user=tye" parameter that isn't preserved by the "Talk" submit. Even if you enter "&user=tye" into the URL, PM submits are hard-coded to only preserve "node_id" parameters so the same problem persists. Changing PM's form generation code to either add (most?) current parameters to the "action=" attribute of forms or to add them as hidden input fields would fix this problem (though a general solution for this won't be trivial).

            - tye (but my friends call me "Tye")
      Ahh, my bag, that is different then. When faced with a similar problem, I modified the form and self_url functions to include params that should persist.

      -Lee

      "To be civilized is to deny one's nature."