On Thu, 23 May 2002, tomasz konefal wrote:
>
> as it stands, i've got a run mode which displays the form
> (add_monitor) and accepts input. when the form is submitted, it is
> redirected via hidden form input to the 'add_monitor_process' run mode
> (this run mode does not display anything to the user directly). it
> verifies the input and if it's clean attempts to add it to the database.
> if successful it issues "return $self->add_successful('monitor')",
> otherwise it issues "return $self->error_page('couldn't add monitor')".
>
> this last part with the returns just doesn't feel right - is there a
> way which is preferred by the C::A gurus out there that i haven't
> heard/thought of? could the new prerun code in C::A help with this?
This is almost exactly what I do. The one difference my standard setup
is that if there is an error, I return the original form, pre-filled
with their data, with a general error message at the top of the page and
some text to highlight the problem spots. It's a little more work to do
this, but know I nearly always use this system, figuring that for a
small form it's only a little extra work, and for a very large form,
this kind of context makes a big difference.
I've got a web-to-email form app that uses this that's almost generic
enough to release as stand-a-lone module.
-mark
http://mark.stosberg.com/
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[email protected]/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]