Jump to content

Topic on Talk:HTMLForm

Tim.landscheidt (talkcontribs)

I'm working on an extension similar in usage to Booksources. I want to achieve the following behaviour:

  1. If no parameters are supplied, an empty form is displayed.
  2. If some parameters or parameters with errors are supplied, a form preset with the parameters and any error messages is displayed.
  3. If all parameters are valid, a function is executed.

However with $htmlForm->setMethod ('get'), while parameter ranges are checked (e. g. lat=5555) and such errors yield in the display of a form, missing required parameters (e. g. omitting lat) or supplying no parameters at all doesn't display a form, but executes the submit callback.

With $htmlForm->setMethod ('post'), a form is always displayed and the submit callback never executed unless subsequently clicked by the user, but also the fields are preset with the values from the GET query string, but no error messages are displayed for parameters out of bounds.

As the class still seems to be in flux, I don't want to file a bug, but start a discussion.

Reply to "setMethod ()"