[dev] Horde_Form submit variable action

Richard Wallace rwallace at thewallacepack.net
Thu Jan 13 10:41:27 PST 2005


Hey guys,

I'm having a problem with setting a submit action on an enum form variable.  My
form is a multi-step form similar to the whups bug creation form, which is what
I've been using as a reference.  The first step is to select one thing from a
selection drop down.  I've got the submit action working fine for that.

The problem is that when you do move onto step 2, that drop down should still be
changable for ease of use.  This differs in how it's used in whups because
after selecting a queue in whups you can't change it.  But that just won't work
in this situation.  So, if you're in the second part of this form and you go
and change the selection from the first part the form should be resubmitted and
the form elements in the second part of the form will be different (not an
uncommon scenario).

The thing is that the action for that selection is using the form name from the
first step rather than that of the second step.  So, rather than being
'document.step2form.submit()', the onchange js is
'document.step1form.submit()'.  This causes a javascript error since the form
is actually named step2form.

I've tried a number of things to workaround this, none of them pretty.  One was
to create a custom action that extends the submit action and provide it with
the name of the form that should actually be used.  This doesn't work well,
though, because I don't know when constructing the form1 whether it is going to
be the one rendered or if the form2 is going to be rendered, so I run into a
chicken and egg problem.

I'll file this as a bug if you guys think it is appropriate, but I didn't want
to do that until I asked on the list.  Any body have any suggestions?

Thanks,
Rich



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


More information about the dev mailing list