Am using CAP::ValidateRM to handle web-form validation, and all works as
expected - if missing or invalid fields, return $obj->dfv_error_page()
without updating database, otherwise update database and
$obj->forward('desired_runmode').

But now the client wants the database to be updated with fields that have passed validation, and still be alerted to missing/invalid fields.

So instead of returning $obj->dfv_error_page() only on check_rm()
failure, ie:

$obj->check_rm('run_mode', '_validate_run_mode')
|| return $obj->dfv_error_page();

each run_mode now returns the $obj->dfv_error_page() - after updating
db with any input data - irrespective of any errors.

This would work fine, except that my web-pages are multi-form, with many
separate sections like:
<form method="post" action="" enctype="multipart/form-data">
    <input type="hidden" name="rm" value="desired_runmode" />
    ....
    <input type="submit" value="Update" />
</form>

which normally works fine, except in the above scenario where the
dfv_error_page() has changed all instances of value="desired_runmode" into value="name of the current run-mode". So when we fill in the next section of the web-page and submit the data, the previous run_mode (which generated the dfv_error_page) gets called, no matter which sections' submit button is pressed. This means the new data submitted is lost as we don't go to the relevant run_mode to process it.

Presumably changing all rm's to the current rm is the intended behaviour
of ValidateRM / HTML::FillInForm, but is there anything I can do to
modify this so it works the way I desire, or is it not possible? Hope it
all makes sense.






---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
             http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to