[Zope] Form Action question
McDonnell, Larry
lmcdonnell@protonenergy.com
Tue, 5 Nov 2002 10:21:55 -0500
Hi,
I am trying to have one of my forms provide the user the ability to choose
what form to select next. I have done something similar to this in a
previous form. In the first form I provide a pull down menu to let them
select (Report vs. Input forms). I define the menu_type variable and submit
the form. The next form, the user is still making some choices so this is
where I set the variable globally (<dtml-call
"REQUEST.SESSION.set('menu_type', menu_type)"> ). The user is making their
final selection in this form and in the form action field I use this
statement (action=<dtml-var expr="REQUEST.SESSION['menu_type']">) and this
works. The user is in the form they selected and they are happy.
I am working on some input forms now. The first form, the user will input a
part number. The next form will display the title of the part number and any
actions relating to this part number (RMAs, etc). At this point, if the user
can continue to identify a problem with this part and fill in the header
info (customer, address, etc.). What the user wants is the ability to add
line item information about each serial number relating to the part. This is
my problem.
I can let them add one disposition. I tried the following:
I made the <input type="hidden" name="menu_type"> on the first form.
The next form the user can fill out the form and the "form action" will call
a decision form. Also, I global define this variable <dtml-call
"REQUEST.SESSION.set('menu_type', menu_type)">
The form is as follows:
<form name="form1" method="post" action=<dtml-var
expr="REQUEST.SESSION['menu_type']">>
<select name="<dtml-var expr="REQUEST.SESSION['menu_type']"> ">
<option value="update_nonc_partb">Add another disposition</option>
<option value="update_nonc_partb_info">Save</option>
</select>
<dtml-var expr="REQUEST.SESSION['menu_type']">
<input type="submit" name="Submit" value="Submit">
</form>
I have tried different variation but I will get a keyerror or a global
error. Any pointers would be great.
Sorry for the winded message but I thought some background would help.
Thanks in advance.
Larry McDonnell
Proton Energy Systems
10 Technology Drive
Wallingford, CT 06492
(203) 678-2181
Email:lmcdonnell@protonenergy.com
www.protonenergy.com