[Zope] A Really Smart Form Chain

Matt Goodall m.g.goodall@ntlworld.com
14 Nov 2001 00:30:41 +0000


On Tue, 2001-11-13 at 21:20, Mike Renfro wrote:
> On Tue, Nov 13, 2001 at 02:17:29PM -0700, Harlow Pinson wrote:
> 
> > Does anyone have an example to share of a multipage form chain or
> > wizard that allows use of embeded back and next buttons or
> > hyperlinks, and allows the user to freely move between pages without
> > clobbering previous input?
> 
> Don't know about hyperlinks working (wouldn't you have to encode all
> the variables into the URL for that to work?), but buttons should work
> fine.

You can use JavaScript, attached to the HREF's onclick attribute to
submit the form. That way you don't have to do any manual URL encoding.
i.e.

<form name="myform">
  <a
    href=""
    onclick="javascript: document.myform.submit(); return false;"
    >forward</a>
</form>

Obviously, that will not work if the user has JavaScript turned off.

Cheers, Matt