RA Jones writes:
> Michael Peters wrote:
> >
> > RA Jones wrote:
> >> 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.
> >
> > Well, HTML::FillInForm will fill in everything unless it's told not to.
> > You can
> > pass extra args to it as a third argument to check_rm(). You can either
> > tell it
> > to ignore fields named 'rm' or you can tell it which form you want to fill.
> >
> > $obj->check_rm('run_mode', '_validate_run_mode', {ignore_fields =>
> > ['rm']},)
> > || return $obj->dfv_error_page();
> >
> > or
> >
> > $obj->check_rm('run_mode', '_validate_run_mode', {target => 'form1' },)
> > || return $obj->dfv_error_page();
> >
>
> OK, thanks. So the behaviour is caused by FillInForm, and nothing to do
> with CAP::Forward. I did see something about ignore_fields but missed
> its significance. Makes me wonder if FiF is optimally suited for use
> with multi-form web-pages using hidden fields called rm.
>
> And can already confirm initial trial using ignore_fields seems to be
> doing the right thing. Many thanks.
I tripped over this a couple of weeks ago and Cees replied with the
hint that one can have FillInForm only fill in a particular form,
which should solve the problem.
I'd already stumbled over the ignore_fields solution and it "worked"
well enough for me, so I haven't checked out his suggestion. I've
attached his message in case it's an interesting alternative for you.
g.
--- Begin Message ---
On 9/26/06, George Hartzell <[EMAIL PROTECTED]> wrote:
George Hartzell writes:
>
> I have a page that has several forms, each form has a hidden input
> named "rm" which specifies a unique the runmode for the contents of
> that form.
>
> The runmodes use CAP::ValdateRM. When there's an error, it generates
> an error page for me but files in *all* of the forms' "rm" input
> variables with the value of the runmode that generated the error.
>
> I understand why it's happening, but the resulting form doesn't do the
> right thing if someone chooses one of the other submit buttons.
>
> Anyone have any suggested work arounds?
I apologize for answering my own questions, but adding
{ ignore_fields => ['rm'] },
to the check_rm call seems to make it behave.
Does that seem like the right solution?
You should also be able to name your forms, and have HTML::FillInFOrm
(which is used under the covers by ValidateRM) only fill in the form
you are concerned about. This means all other forms on the page are
left as is.
See the docs for HTML::FillInForm for the right syntax.
Cheers,
Cees
--- End Message ---
---------------------------------------------------------------------
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]