If you have a line like
<input type="text" name="first_name"
in your html file then if you try the following in
your script file
you should see "default value" printed
you can try:
to see the entire contents of REQUEST (very
Note: if you do not have a default value in your
<input> statement and you do not enter anything in the input field when
the form is displayed, then when the form is submitted REQUEST will not contain
an entry for the corresponding form field (an entry is made in REQUEST only when
data is entered in the form field)
----- Original Message -----
Sent: Thursday, August 17, 2006 4:40
Subject: Re: [Zope] Python Scripts and
Sorry about that, what I meant is that I get a
KeyError. It says that the first_name in REQUEST['first_name'] is not found,
when I try to set the variable in line in the script where fname =
On 8/17/06, Jonathan <
[EMAIL PROTECTED]> wrote:
What does "it doesn't seem to work" mean?
Error messages/traceback? What does your form & script contain?
More info on the problem is definitely required!
Original Message -----
Thursday, August 17, 2006 4:20 PM
Re: [Zope] Python Scripts and HTML Forms
Hey Jonathan, All,
Thanks I tried your solution, but
it doesn't seem to work. Can anybody shed some more light on this
situation, since what Jonathan provides is exactly what I want to do, but
it's not working.
Am I forgetting to put parameteres or some other
newbie mistake like that?
Thanks in advance and thanks again
On 8/17/06, Jonathan <[EMAIL PROTECTED]> wrote:
Form variables are stored in REQUEST. In a
python script you gain access to REQUEST by:
you can then access the form variables
fname = REQUEST['first_name']
you can check for the presence of a form
Original Message -----
Thursday, August 17, 2006 2:57 PM
[Zope] Python Scripts and HTML Forms
Dear Trusted Zope Zealots,
This subject was a bit
too broad to do a google search on, because I've tried and the lack of
relevancy was astounding.
I've probably been committing a cardinal
sin in DTML, but I couldn't figure any other work around.
an HTML form in a DTML Document say:
I want to use
"first_name" in a python script, but what I've been doing is setting it in
the process_this_form, which is a DTML method:
<dtml-call "REQUEST.SESSION.set ('firstName',
and in the Python Script,
What my question is, is there
anyway to directly access "first_name" from the form in the python script
without having to have to call the <dtml-call "
REQUEST.SESSION.set('firstName', first_name)> and then
REQUEST.SESSION.get('firstName') in the python script. Sort of a
sophomoric question, but any help would be appreciated. Thanks in