Personally I use Django to build my forms. I've done complex multi-step forms, where steps are conditional by using the django.contrib.formtools.FormWizard
and using a factoryfunction to create the Form class for the step like this:
class SomeWizard(FormWizard):
def process_step(self, request, form, step):
if form.is_valid() and step == 0:
#compute step 2
Step2 = second_step_factory(form)
self.form_list[1] = Step2
And the step it with a placeholder when instantiating the Wizard object:
def some_form_view(request):
Step1 = first_step_factory(request)
placeholder = second_step_factory()
return SomeWizard([Step1, placeholder])(request)
In Django 1.4 the FormWizard has been replaced by a different implementation, I've not looked at that yet.
If you want a language neutral, more declarative option, you can have a look at XForms. Browser support seems a bit abandoned, but there are XSLTs that will transform your XForms into HTML.