[Zope] Help with DTML Forms
Greg & Janet LINDSTROM
yuba@cyberback.com
Thu, 1 May 2003 22:11:53 -0500
This is a multi-part message in MIME format.
------=_NextPart_000_0005_01C3102E.ABC59AA0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I would like to create a DTML Form that may be called with or without an =
argument (say, member_number). I have tried something like this, a DTML =
Form named AddAddressForm:
<dtml-var standard_arfs_header>
<dtml-form method=3Dpost action=3DAddAddress>
<table>
<dtml-unless member_number>
<tr>
<th>Member Number</th>
<td><input type=3Dtext name=3Dmember_number></td>
</tr>
</dtml-unless>
<tr>
<th>Address</th>
<th>City</th>
</tr>
<tr>
<td><input type=3Dtext name=3Daddress type=3Dstring></td>
<td><input type=3Dtext name=3Dcity type=3Dstring></td>
</tr>
<tr>
<td colspan=3D2><input type=3Dsubmit></td>
</tr>
</table>
</dtml-form>
My intent is to have a form that, if called with no input paramters, =
will display a field so I can enter the member_number. If the form is =
called with an input parameter, the member_number field will not be =
displayed, but the passed in value will be passed on to the AddAddress =
Method.
The AddAddress method called by the form is a DTML Method which, in =
turn, calls a ZSQL Method to add the information to the database.
The AddAddressForm will be called from another DTML Form. The line =
calling the above code looks like this:
<a =
href=3D"......./AddAddress?member_number=3D&dtml-member_number;">Add</a>
The only way I can "see" the member_number in the AddAddressForm is to =
use <dtml-var member_number>. The shorthand _['member_number'] and =
&dtml-member_number; do not seem to work. Is this because of the =
namespace issues with the DTML Form?
Am I trying to do too much here? I could make two forms, but I don't =
like the idea of maintaining two nearly identical forms. Can this be =
done?
Thanks for your help.
--greg
------=_NextPart_000_0005_01C3102E.ABC59AA0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2600.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>I would like to create a DTML Form that =
may be=20
called with or without an argument (say, member_number). I have =
tried=20
something like this, a DTML Form named AddAddressForm:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><dtml-var =
standard_arfs_header></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><dtml-form method=3Dpost=20
action=3DAddAddress></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> <table></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> <dtml-unless=20
member_number></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
<tr></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
<th>Member Number</th></FONT></DIV>
<DIV><FONT face=3DArial=20
size=3D2> <td><input =
type=3Dtext=20
name=3Dmember_number></td></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
</tr></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =
</dtml-unless></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> <tr></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
<th>Address</th></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> =20
<th>City</th></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> </tr></FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2> <tr></FONT></DIV><FONT face=3DArial=20
size=3D2>
<DIV><FONT face=3DArial =
size=3D2> =20
<td><input type=3Dtext name=3Daddress =
type=3Dstring></td>
<DIV><FONT face=3DArial =
size=3D2> =20
<td><input type=3Dtext name=3Dcity=20
type=3Dstring></td></FONT></DIV></FONT></DIV>
<DIV></FONT><FONT face=3DArial size=3D2> </tr></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> <tr></FONT></DIV>
<DIV><FONT face=3DArial =
size=3D2> <td=20
colspan=3D2><input type=3Dsubmit></td></FONT></DIV>
<DIV><FONT face=3DArial size=3D2> </tr></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></table></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></dtml-form></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>My intent is to have a form that, if =
called with no=20
input paramters, will display a field so I can enter the =
member_number. If=20
the form is called with an input parameter, the member_number field will =
not be=20
displayed, but the passed in value will be passed on to the =
AddAddress=20
Method.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>The AddAddress method called by the =
form is a DTML=20
Method which, in turn, calls a ZSQL Method to add the information to the =
database.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>The AddAddressForm will be called from =
another DTML=20
Form. The line calling the above code looks like =
this:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> <a=20
href=3D"......./AddAddress?member_number=3D&dtml-member_number;">A=
dd</a></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>The only way I can "see" the =
member_number in the=20
AddAddressForm is to use <dtml-var member_number>. The =
shorthand=20
_['member_number'] and &dtml-member_number; do not seem to =
work. Is=20
this because of the namespace issues with the DTML Form?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Am I trying to do too much here? =
I could make=20
two forms, but I don't like the idea of maintaining two nearly identical =
forms. Can this be done?</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks for your help.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>--greg</FONT></DIV></BODY></HTML>
------=_NextPart_000_0005_01C3102E.ABC59AA0--