Hello, I have now found out that my problem isn't just a select box in Zope, but it is all form processing. I am mostly a PHP programmer so I am used to when you make a text field in a form named e.g. Name it will (when you have hit the submit button and the script you have set as actionscript receives the form) be declared as a variable named Name. But I guess Zope doesn't work this way. So how does a dtml document recieve the fields in a form ? Regards, -- ************************ Gitte Wange Jensen System Squid Developer MMManager Aps +45 29 72 79 72 gitte@mmmanager.org ************************
Zope works exactly that way. It creates entries into the REQUEST variable, which by the wonders of namespaces/acquisition can be used in the current namespace. So in your example doing <dtml-var Name> will put the value of the Name form entry into your html output. hth Phil ----- Original Message ----- From: "Gitte Wange" <gitte@mmmanager.org> To: <zope@zope.org> Sent: Friday, March 30, 2001 11:17 AM Subject: [Zope] Form processing in Zope
Hello,
I have now found out that my problem isn't just a select box in Zope, but it is all form processing.
I am mostly a PHP programmer so I am used to when you make a text field in a form named e.g. Name it will (when you have hit the submit button and the script you have set as actionscript receives the form) be declared as a variable named Name.
But I guess Zope doesn't work this way.
So how does a dtml document recieve the fields in a form ?
Regards,
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
Believe it or not - I actually understand so far :-) Now I only have one problem. I need to test on the value from the select box, eg: The selectbox is names ActionList. <dtml-if expr="ActionList == 1"> Do this <dtml-elif expr="ActionList == 2"> Do that. But when I say <dtml-id expr="<dtml-var ActionList> == 1"> I get a syntax error. Help ? Gitte On 30 Mar 2001 11:38:47 +0100, Phil Harris wrote:
Zope works exactly that way.
It creates entries into the REQUEST variable, which by the wonders of namespaces/acquisition can be used in the current namespace.
So in your example doing <dtml-var Name> will put the value of the Name form entry into your html output.
hth
Phil
----- Original Message ----- From: "Gitte Wange" <gitte@mmmanager.org> To: <zope@zope.org> Sent: Friday, March 30, 2001 11:17 AM Subject: [Zope] Form processing in Zope
Hello,
I have now found out that my problem isn't just a select box in Zope, but it is all form processing.
I am mostly a PHP programmer so I am used to when you make a text field in a form named e.g. Name it will (when you have hit the submit button and the script you have set as actionscript receives the form) be declared as a variable named Name.
But I guess Zope doesn't work this way.
So how does a dtml document recieve the fields in a form ?
Regards,
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- ************************ Gitte Wange Jensen System Squid Developer MMManager Aps +45 29 72 79 72 gitte@mmmanager.org ************************
Why don't you try this? <dtml-if expr="ActionList == '1'"> Do this <dtml-elif expr="ActionList == '2'"> Do that. </dtml-if> Notice the single quotes around '1' and '2', if you didn't coerce the variables already then they're going to come in as strings. Phil ----- Original Message ----- From: "Gitte Wange" <gitte@babytux.dk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Friday, March 30, 2001 12:00 PM Subject: Re: [Zope] Form processing in Zope
Believe it or not - I actually understand so far :-)
Now I only have one problem.
I need to test on the value from the select box, eg: The selectbox is names ActionList.
<dtml-if expr="ActionList == 1"> Do this <dtml-elif expr="ActionList == 2"> Do that.
But when I say <dtml-id expr="<dtml-var ActionList> == 1"> I get a syntax error.
Help ?
Gitte
On 30 Mar 2001 11:38:47 +0100, Phil Harris wrote:
Zope works exactly that way.
It creates entries into the REQUEST variable, which by the wonders of namespaces/acquisition can be used in the current namespace.
So in your example doing <dtml-var Name> will put the value of the Name form entry into your html output.
hth
Phil
----- Original Message ----- From: "Gitte Wange" <gitte@mmmanager.org> To: <zope@zope.org> Sent: Friday, March 30, 2001 11:17 AM Subject: [Zope] Form processing in Zope
Hello,
I have now found out that my problem isn't just a select box in Zope, but it is all form processing.
I am mostly a PHP programmer so I am used to when you make a text field in a form named e.g. Name it will (when you have hit the submit button and the script you have set as actionscript receives the form) be declared as a variable named Name.
But I guess Zope doesn't work this way.
So how does a dtml document recieve the fields in a form ?
Regards,
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
On 30 Mar 2001 12:06:05 +0100, Phil Harris wrote:
Why don't you try this?
<dtml-if expr="ActionList == '1'"> Do this <dtml-elif expr="ActionList == '2'"> Do that. </dtml-if>
Notice the single quotes around '1' and '2', if you didn't coerce the variables already then they're going to come in as strings.
Phil
Then I get a NameError Gitte
----- Original Message ----- From: "Gitte Wange" <gitte@babytux.dk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Friday, March 30, 2001 12:00 PM Subject: Re: [Zope] Form processing in Zope
Believe it or not - I actually understand so far :-)
Now I only have one problem.
I need to test on the value from the select box, eg: The selectbox is names ActionList.
<dtml-if expr="ActionList == 1"> Do this <dtml-elif expr="ActionList == 2"> Do that.
But when I say <dtml-id expr="<dtml-var ActionList> == 1"> I get a syntax error.
Help ?
Gitte
On 30 Mar 2001 11:38:47 +0100, Phil Harris wrote:
Zope works exactly that way.
It creates entries into the REQUEST variable, which by the wonders of namespaces/acquisition can be used in the current namespace.
So in your example doing <dtml-var Name> will put the value of the Name form entry into your html output.
hth
Phil
----- Original Message ----- From: "Gitte Wange" <gitte@mmmanager.org> To: <zope@zope.org> Sent: Friday, March 30, 2001 11:17 AM Subject: [Zope] Form processing in Zope
Hello,
I have now found out that my problem isn't just a select box in Zope, but it is all form processing.
I am mostly a PHP programmer so I am used to when you make a text field in a form named e.g. Name it will (when you have hit the submit button and the script you have set as actionscript receives the form) be declared as a variable named Name.
But I guess Zope doesn't work this way.
So how does a dtml document recieve the fields in a form ?
Regards,
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
-- ************************ Gitte Wange Jensen System Squid Developer MMManager Aps +45 29 72 79 72 gitte@mmmanager.org ************************
What happens if tyou do <dtml-var ActionList> ----- Original Message ----- From: "Gitte Wange" <gitte@babytux.dk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Friday, March 30, 2001 12:10 PM Subject: Re: [Zope] Form processing in Zope
On 30 Mar 2001 12:06:05 +0100, Phil Harris wrote:
Why don't you try this?
<dtml-if expr="ActionList == '1'"> Do this <dtml-elif expr="ActionList == '2'"> Do that. </dtml-if>
Notice the single quotes around '1' and '2', if you didn't coerce the variables already then they're going to come in as strings.
Phil
Then I get a NameError
Gitte
----- Original Message ----- From: "Gitte Wange" <gitte@babytux.dk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Friday, March 30, 2001 12:00 PM Subject: Re: [Zope] Form processing in Zope
Believe it or not - I actually understand so far :-)
Now I only have one problem.
I need to test on the value from the select box, eg: The selectbox is names ActionList.
<dtml-if expr="ActionList == 1"> Do this <dtml-elif expr="ActionList == 2"> Do that.
But when I say <dtml-id expr="<dtml-var ActionList> == 1"> I get a syntax error.
Help ?
Gitte
On 30 Mar 2001 11:38:47 +0100, Phil Harris wrote:
Zope works exactly that way.
It creates entries into the REQUEST variable, which by the wonders
of
namespaces/acquisition can be used in the current namespace.
So in your example doing <dtml-var Name> will put the value of the Name form entry into your html output.
hth
Phil
----- Original Message ----- From: "Gitte Wange" <gitte@mmmanager.org> To: <zope@zope.org> Sent: Friday, March 30, 2001 11:17 AM Subject: [Zope] Form processing in Zope
Hello,
I have now found out that my problem isn't just a select box in Zope, but it is all form processing.
I am mostly a PHP programmer so I am used to when you make a text field in a form named e.g. Name it will (when you have hit the submit button and the script you have set as actionscript receives the form) be declared as a variable named Name.
But I guess Zope doesn't work this way.
So how does a dtml document recieve the fields in a form ?
Regards,
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
On 30 Mar 2001 12:17:08 +0100, Phil Harris wrote:
What happens if tyou do <dtml-var ActionList>
I get a NameError Well action of the form is set to index_html Can't I do that ? Because if I should make a method that recieves the value of the ActionList, then I need to get that value back to index_html to find out which selectbox to display next Gitte
----- Original Message ----- From: "Gitte Wange" <gitte@babytux.dk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Friday, March 30, 2001 12:10 PM Subject: Re: [Zope] Form processing in Zope
On 30 Mar 2001 12:06:05 +0100, Phil Harris wrote:
Why don't you try this?
<dtml-if expr="ActionList == '1'"> Do this <dtml-elif expr="ActionList == '2'"> Do that. </dtml-if>
Notice the single quotes around '1' and '2', if you didn't coerce the variables already then they're going to come in as strings.
Phil
Then I get a NameError
Gitte
----- Original Message ----- From: "Gitte Wange" <gitte@babytux.dk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Friday, March 30, 2001 12:00 PM Subject: Re: [Zope] Form processing in Zope
Believe it or not - I actually understand so far :-)
Now I only have one problem.
I need to test on the value from the select box, eg: The selectbox is names ActionList.
<dtml-if expr="ActionList == 1"> Do this <dtml-elif expr="ActionList == 2"> Do that.
But when I say <dtml-id expr="<dtml-var ActionList> == 1"> I get a syntax error.
Help ?
Gitte
On 30 Mar 2001 11:38:47 +0100, Phil Harris wrote:
Zope works exactly that way.
It creates entries into the REQUEST variable, which by the wonders
of
namespaces/acquisition can be used in the current namespace.
So in your example doing <dtml-var Name> will put the value of the Name form entry into your html output.
hth
Phil
----- Original Message ----- From: "Gitte Wange" <gitte@mmmanager.org> To: <zope@zope.org> Sent: Friday, March 30, 2001 11:17 AM Subject: [Zope] Form processing in Zope
Hello,
I have now found out that my problem isn't just a select box in Zope, but it is all form processing.
I am mostly a PHP programmer so I am used to when you make a text field in a form named e.g. Name it will (when you have hit the submit button and the script you have set as actionscript receives the form) be declared as a variable named Name.
But I guess Zope doesn't work this way.
So how does a dtml document recieve the fields in a form ?
Regards,
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
-- ************************ Gitte Wange Jensen System Squid Developer MMManager Aps +45 29 72 79 72 gitte@mmmanager.org ************************
Gitte, try putting this <dtml-var REQUEST> into your page, and see what form variables are being returned. ----- Original Message ----- From: "Gitte Wange" <gitte@babytux.dk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Friday, March 30, 2001 12:19 PM Subject: Re: [Zope] Form processing in Zope
On 30 Mar 2001 12:17:08 +0100, Phil Harris wrote:
What happens if tyou do <dtml-var ActionList>
I get a NameError
Well action of the form is set to index_html Can't I do that ?
Because if I should make a method that recieves the value of the ActionList, then I need to get that value back to index_html to find out which selectbox to display next
Gitte
----- Original Message ----- From: "Gitte Wange" <gitte@babytux.dk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Friday, March 30, 2001 12:10 PM Subject: Re: [Zope] Form processing in Zope
On 30 Mar 2001 12:06:05 +0100, Phil Harris wrote:
Why don't you try this?
<dtml-if expr="ActionList == '1'"> Do this <dtml-elif expr="ActionList == '2'"> Do that. </dtml-if>
Notice the single quotes around '1' and '2', if you didn't coerce the variables already then they're going to come in as strings.
Phil
Then I get a NameError
Gitte
----- Original Message ----- From: "Gitte Wange" <gitte@babytux.dk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Friday, March 30, 2001 12:00 PM Subject: Re: [Zope] Form processing in Zope
Believe it or not - I actually understand so far :-)
Now I only have one problem.
I need to test on the value from the select box, eg: The selectbox is names ActionList.
<dtml-if expr="ActionList == 1"> Do this <dtml-elif expr="ActionList == 2"> Do that.
But when I say <dtml-id expr="<dtml-var ActionList> == 1"> I get a syntax error.
Help ?
Gitte
On 30 Mar 2001 11:38:47 +0100, Phil Harris wrote:
Zope works exactly that way.
It creates entries into the REQUEST variable, which by the
wonders of
namespaces/acquisition can be used in the current namespace.
So in your example doing <dtml-var Name> will put the value of the Name form entry into your html output.
hth
Phil
----- Original Message ----- From: "Gitte Wange" <gitte@mmmanager.org> To: <zope@zope.org> Sent: Friday, March 30, 2001 11:17 AM Subject: [Zope] Form processing in Zope
> Hello, > > I have now found out that my problem isn't just a select box in Zope, > but it is all form processing. > > I am mostly a PHP programmer so I am used to when you make a text field > in a form named e.g. Name it will (when you have hit the submit button > and the script you have set as actionscript receives the form) be > declared as a variable named Name. > > But I guess Zope doesn't work this way. > > So how does a dtml document recieve the fields in a form ? > > Regards, > > -- > ************************ > Gitte Wange Jensen > > System Squid Developer > MMManager Aps > +45 29 72 79 72 > > gitte@mmmanager.org > ************************ > > > _______________________________________________ > Zope maillist - Zope@zope.org > http://lists.zope.org/mailman/listinfo/zope > ** No cross posts or HTML encoding! ** > (Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope-dev )
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
On 30 Mar 2001 12:23:51 +0100, Phil Harris wrote:
Gitte,
try putting this
<dtml-var REQUEST>
into your page, and see what form variables are being returned.
phew it gives a lot ! But I discovered one thing: When you enter the site, there is no variable named ActionList, but when you hit the submit button there is a ActionList with value=1 hmm .. what now? I need to test for that variable but it has to be declared before running the script. Has anyone had these kinds of problems ? Gitte
----- Original Message ----- From: "Gitte Wange" <gitte@babytux.dk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Friday, March 30, 2001 12:19 PM Subject: Re: [Zope] Form processing in Zope
On 30 Mar 2001 12:17:08 +0100, Phil Harris wrote:
What happens if tyou do <dtml-var ActionList>
I get a NameError
Well action of the form is set to index_html Can't I do that ?
Because if I should make a method that recieves the value of the ActionList, then I need to get that value back to index_html to find out which selectbox to display next
Gitte
----- Original Message ----- From: "Gitte Wange" <gitte@babytux.dk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Friday, March 30, 2001 12:10 PM Subject: Re: [Zope] Form processing in Zope
On 30 Mar 2001 12:06:05 +0100, Phil Harris wrote:
Why don't you try this?
<dtml-if expr="ActionList == '1'"> Do this <dtml-elif expr="ActionList == '2'"> Do that. </dtml-if>
Notice the single quotes around '1' and '2', if you didn't coerce the variables already then they're going to come in as strings.
Phil
Then I get a NameError
Gitte
----- Original Message ----- From: "Gitte Wange" <gitte@babytux.dk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Friday, March 30, 2001 12:00 PM Subject: Re: [Zope] Form processing in Zope
Believe it or not - I actually understand so far :-)
Now I only have one problem.
I need to test on the value from the select box, eg: The selectbox is names ActionList.
<dtml-if expr="ActionList == 1"> Do this <dtml-elif expr="ActionList == 2"> Do that.
But when I say <dtml-id expr="<dtml-var ActionList> == 1"> I get a syntax error.
Help ?
Gitte
On 30 Mar 2001 11:38:47 +0100, Phil Harris wrote: > Zope works exactly that way. > > It creates entries into the REQUEST variable, which by the
wonders of
> namespaces/acquisition can be used in the current namespace. > > So in your example doing <dtml-var Name> will put the value of the Name form > entry into your html output. > > hth > > Phil > > > ----- Original Message ----- > From: "Gitte Wange" <gitte@mmmanager.org> > To: <zope@zope.org> > Sent: Friday, March 30, 2001 11:17 AM > Subject: [Zope] Form processing in Zope > > > > Hello, > > > > I have now found out that my problem isn't just a select box in Zope, > > but it is all form processing. > > > > I am mostly a PHP programmer so I am used to when you make a text field > > in a form named e.g. Name it will (when you have hit the submit button > > and the script you have set as actionscript receives the form) be > > declared as a variable named Name. > > > > But I guess Zope doesn't work this way. > > > > So how does a dtml document recieve the fields in a form ? > > > > Regards, > > > > -- > > ************************ > > Gitte Wange Jensen > > > > System Squid Developer > > MMManager Aps > > +45 29 72 79 72 > > > > gitte@mmmanager.org > > ************************ > > > > > > _______________________________________________ > > Zope maillist - Zope@zope.org > > http://lists.zope.org/mailman/listinfo/zope > > ** No cross posts or HTML encoding! ** > > (Related lists - > > http://lists.zope.org/mailman/listinfo/zope-announce > > http://lists.zope.org/mailman/listinfo/zope-dev ) > > > _______________________________________________ > Zope maillist - Zope@zope.org > http://lists.zope.org/mailman/listinfo/zope > ** No cross posts or HTML encoding! ** > (Related lists - > http://lists.zope.org/mailman/listinfo/zope-announce > http://lists.zope.org/mailman/listinfo/zope-dev )
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
-- ************************ Gitte Wange Jensen System Squid Developer MMManager Aps +45 29 72 79 72 gitte@mmmanager.org ************************
Testing for existence is even easier than you think: <dtml-if ActionList> <dtml-if expr="ActionList == '1'"> Do this <dtml-elif expr="ActionList == '2'"> Do that. </dtml-if> <dtml-else> ActionList not yet set. </dtml-if> Phil ----- Original Message ----- From: "Gitte Wange" <gitte@babytux.dk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Friday, March 30, 2001 12:28 PM Subject: Re: [Zope] Form processing in Zope
On 30 Mar 2001 12:23:51 +0100, Phil Harris wrote:
Gitte,
try putting this
<dtml-var REQUEST>
into your page, and see what form variables are being returned.
phew it gives a lot !
But I discovered one thing: When you enter the site, there is no variable named ActionList, but when you hit the submit button there is a ActionList with value=1
hmm .. what now? I need to test for that variable but it has to be declared before running the script. Has anyone had these kinds of problems ?
Gitte
----- Original Message ----- From: "Gitte Wange" <gitte@babytux.dk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Friday, March 30, 2001 12:19 PM Subject: Re: [Zope] Form processing in Zope
On 30 Mar 2001 12:17:08 +0100, Phil Harris wrote:
What happens if tyou do <dtml-var ActionList>
I get a NameError
Well action of the form is set to index_html Can't I do that ?
Because if I should make a method that recieves the value of the ActionList, then I need to get that value back to index_html to find
out
which selectbox to display next
Gitte
----- Original Message ----- From: "Gitte Wange" <gitte@babytux.dk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Friday, March 30, 2001 12:10 PM Subject: Re: [Zope] Form processing in Zope
On 30 Mar 2001 12:06:05 +0100, Phil Harris wrote:
Why don't you try this?
<dtml-if expr="ActionList == '1'"> Do this <dtml-elif expr="ActionList == '2'"> Do that. </dtml-if>
Notice the single quotes around '1' and '2', if you didn't coerce the variables already then they're going to come in as strings.
Phil
Then I get a NameError
Gitte
----- Original Message ----- From: "Gitte Wange" <gitte@babytux.dk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Friday, March 30, 2001 12:00 PM Subject: Re: [Zope] Form processing in Zope
> Believe it or not - I actually understand so far :-) > > Now I only have one problem. > > I need to test on the value from the select box, eg: > The selectbox is names ActionList. > > <dtml-if expr="ActionList == 1"> > Do this > <dtml-elif expr="ActionList == 2"> > Do that. > > But when I say <dtml-id expr="<dtml-var ActionList> == 1"> > I get a syntax error. > > Help ? > > Gitte > > > On 30 Mar 2001 11:38:47 +0100, Phil Harris wrote: > > Zope works exactly that way. > > > > It creates entries into the REQUEST variable, which by the
wonders of
> > namespaces/acquisition can be used in the current namespace. > > > > So in your example doing <dtml-var Name> will put the value of the Name form > > entry into your html output. > > > > hth > > > > Phil > > > > > > ----- Original Message ----- > > From: "Gitte Wange" <gitte@mmmanager.org> > > To: <zope@zope.org> > > Sent: Friday, March 30, 2001 11:17 AM > > Subject: [Zope] Form processing in Zope > > > > > > > Hello, > > > > > > I have now found out that my problem isn't just a select box in Zope, > > > but it is all form processing. > > > > > > I am mostly a PHP programmer so I am used to when you make a text field > > > in a form named e.g. Name it will (when you have hit the submit button > > > and the script you have set as actionscript receives the form) be > > > declared as a variable named Name. > > > > > > But I guess Zope doesn't work this way. > > > > > > So how does a dtml document recieve the fields in a form ? > > > > > > Regards, > > > > > > -- > > > ************************ > > > Gitte Wange Jensen > > > > > > System Squid Developer > > > MMManager Aps > > > +45 29 72 79 72 > > > > > > gitte@mmmanager.org > > > ************************ > > > > > > > > > _______________________________________________ > > > Zope maillist - Zope@zope.org > > > http://lists.zope.org/mailman/listinfo/zope > > > ** No cross posts or HTML encoding! ** > > > (Related lists - > > > http://lists.zope.org/mailman/listinfo/zope-announce > > > http://lists.zope.org/mailman/listinfo/zope-dev ) > > > > > > _______________________________________________ > > Zope maillist - Zope@zope.org > > http://lists.zope.org/mailman/listinfo/zope > > ** No cross posts or HTML encoding! ** > > (Related lists - > > http://lists.zope.org/mailman/listinfo/zope-announce > > http://lists.zope.org/mailman/listinfo/zope-dev ) > > > > -- > ************************ > Gitte Wange Jensen > > System Squid Developer > MMManager Aps > +45 29 72 79 72 > > gitte@mmmanager.org > ************************
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
Hi, a problem could arrise, if the content of "ActionList" is evaluated to "false" eg, if it contains 0 or empty string and so on. In your case, Gitte, there schould be no problem. But think about this if you write other forms :-) One way is to check if the submit-button has been sent: <form method="POST"> ... <input type="submit" name="sent_form" value="OK"> </form> So you can test for the existence of "sent_form". Note: never use the value of the submit-button if possible. (this is an issue with localisation) Note2: try to not explicitely link to index_html. This is a method of the container-object and it is its default method if you just call the object itself via web. In most cases not specifying the "action" attribute of the form tag should fit. Regards Tino Phil Harris wrote:
Testing for existence is even easier than you think:
<dtml-if ActionList> <dtml-if expr="ActionList == '1'"> Do this <dtml-elif expr="ActionList == '2'"> Do that. </dtml-if> <dtml-else> ActionList not yet set. </dtml-if>
Phil
----- Original Message ----- From: "Gitte Wange" <gitte@babytux.dk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Friday, March 30, 2001 12:28 PM Subject: Re: [Zope] Form processing in Zope
On 30 Mar 2001 12:23:51 +0100, Phil Harris wrote:
Gitte,
try putting this
<dtml-var REQUEST>
into your page, and see what form variables are being returned.
phew it gives a lot !
But I discovered one thing: When you enter the site, there is no variable named ActionList, but when you hit the submit button there is a ActionList with value=1
hmm .. what now? I need to test for that variable but it has to be declared before running the script. Has anyone had these kinds of problems ?
Gitte
----- Original Message ----- From: "Gitte Wange" <gitte@babytux.dk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Friday, March 30, 2001 12:19 PM Subject: Re: [Zope] Form processing in Zope
On 30 Mar 2001 12:17:08 +0100, Phil Harris wrote:
What happens if tyou do <dtml-var ActionList>
I get a NameError
Well action of the form is set to index_html Can't I do that ?
Because if I should make a method that recieves the value of the ActionList, then I need to get that value back to index_html to find
out
which selectbox to display next
Gitte
----- Original Message ----- From: "Gitte Wange" <gitte@babytux.dk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Friday, March 30, 2001 12:10 PM Subject: Re: [Zope] Form processing in Zope
On 30 Mar 2001 12:06:05 +0100, Phil Harris wrote: > Why don't you try this? > > <dtml-if expr="ActionList == '1'"> > Do this > <dtml-elif expr="ActionList == '2'"> > Do that. > </dtml-if> > > Notice the single quotes around '1' and '2', if you didn't coerce the > variables already then they're going to come in as strings. > > Phil
Then I get a NameError
Gitte
> > > > > ----- Original Message ----- > From: "Gitte Wange" <gitte@babytux.dk> > To: "Phil Harris" <phil.harris@zope.co.uk> > Cc: <zope@zope.org> > Sent: Friday, March 30, 2001 12:00 PM > Subject: Re: [Zope] Form processing in Zope > > > > Believe it or not - I actually understand so far :-) > > > > Now I only have one problem. > > > > I need to test on the value from the select box, eg: > > The selectbox is names ActionList. > > > > <dtml-if expr="ActionList == 1"> > > Do this > > <dtml-elif expr="ActionList == 2"> > > Do that. > > > > But when I say <dtml-id expr="<dtml-var ActionList> == 1"> > > I get a syntax error. > > > > Help ? > > > > Gitte > > > > > > On 30 Mar 2001 11:38:47 +0100, Phil Harris wrote: > > > Zope works exactly that way. > > > > > > It creates entries into the REQUEST variable, which by the wonders of > > > namespaces/acquisition can be used in the current namespace. > > > > > > So in your example doing <dtml-var Name> will put the value of the Name > form > > > entry into your html output. > > > > > > hth > > > > > > Phil > > > > > > > > > ----- Original Message ----- > > > From: "Gitte Wange" <gitte@mmmanager.org> > > > To: <zope@zope.org> > > > Sent: Friday, March 30, 2001 11:17 AM > > > Subject: [Zope] Form processing in Zope > > > > > > > > > > Hello, > > > > > > > > I have now found out that my problem isn't just a select box in Zope, > > > > but it is all form processing. > > > > > > > > I am mostly a PHP programmer so I am used to when you make a text > field > > > > in a form named e.g. Name it will (when you have hit the submit button > > > > and the script you have set as actionscript receives the form) be > > > > declared as a variable named Name. > > > > > > > > But I guess Zope doesn't work this way. > > > > > > > > So how does a dtml document recieve the fields in a form ? > > > > > > > > Regards, > > > > > > > > -- > > > > ************************ > > > > Gitte Wange Jensen > > > > > > > > System Squid Developer > > > > MMManager Aps > > > > +45 29 72 79 72 > > > > > > > > gitte@mmmanager.org > > > > ************************ > > > > > > > > > > > > _______________________________________________ > > > > Zope maillist - Zope@zope.org > > > > http://lists.zope.org/mailman/listinfo/zope > > > > ** No cross posts or HTML encoding! ** > > > > (Related lists - > > > > http://lists.zope.org/mailman/listinfo/zope-announce > > > > http://lists.zope.org/mailman/listinfo/zope-dev ) > > > > > > > > > _______________________________________________ > > > Zope maillist - Zope@zope.org > > > http://lists.zope.org/mailman/listinfo/zope > > > ** No cross posts or HTML encoding! ** > > > (Related lists - > > > http://lists.zope.org/mailman/listinfo/zope-announce > > > http://lists.zope.org/mailman/listinfo/zope-dev ) > > > > > > > > -- > > ************************ > > Gitte Wange Jensen > > > > System Squid Developer > > MMManager Aps > > +45 29 72 79 72 > > > > gitte@mmmanager.org > > ************************
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
But I discovered one thing: When you enter the site, there is no variable named ActionList, but when you hit the submit button there is a ActionList with value=1
Wrap your ACtion list test in a <dtml-if expr="REQUEST.has_key('ActionList')"> </dtml-if>
hmm .. what now? I need to test for that variable but it has to be declared before running the script. Has anyone had these kinds of problems ?
Gitte
----- Original Message ----- From: "Gitte Wange" <gitte@babytux.dk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Friday, March 30, 2001 12:19 PM Subject: Re: [Zope] Form processing in Zope
On 30 Mar 2001 12:17:08 +0100, Phil Harris wrote:
What happens if tyou do <dtml-var ActionList>
I get a NameError
Well action of the form is set to index_html Can't I do that ?
Because if I should make a method that recieves the value of the ActionList, then I need to get that value back to index_html
to find out
which selectbox to display next
Gitte
----- Original Message ----- From: "Gitte Wange" <gitte@babytux.dk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Friday, March 30, 2001 12:10 PM Subject: Re: [Zope] Form processing in Zope
On 30 Mar 2001 12:06:05 +0100, Phil Harris wrote:
Why don't you try this?
<dtml-if expr="ActionList == '1'"> Do this <dtml-elif expr="ActionList == '2'"> Do that. </dtml-if>
Notice the single quotes around '1' and '2', if you didn't coerce the variables already then they're going to come in as strings.
Phil
Then I get a NameError
Gitte
----- Original Message ----- From: "Gitte Wange" <gitte@babytux.dk> To: "Phil Harris" <phil.harris@zope.co.uk> Cc: <zope@zope.org> Sent: Friday, March 30, 2001 12:00 PM Subject: Re: [Zope] Form processing in Zope
> Believe it or not - I actually understand so far :-) > > Now I only have one problem. > > I need to test on the value from the select box, eg: > The selectbox is names ActionList. > > <dtml-if expr="ActionList == 1"> > Do this > <dtml-elif expr="ActionList == 2"> > Do that. > > But when I say <dtml-id expr="<dtml-var ActionList> == 1"> > I get a syntax error. > > Help ? > > Gitte > > > On 30 Mar 2001 11:38:47 +0100, Phil Harris wrote: > > Zope works exactly that way. > > > > It creates entries into the REQUEST variable, which by the
wonders of
> > namespaces/acquisition can be used in the current namespace. > > > > So in your example doing <dtml-var Name> will put the value of the Name form > > entry into your html output. > > > > hth > > > > Phil > > > > > > ----- Original Message ----- > > From: "Gitte Wange" <gitte@mmmanager.org> > > To: <zope@zope.org> > > Sent: Friday, March 30, 2001 11:17 AM > > Subject: [Zope] Form processing in Zope > > > > > > > Hello, > > > > > > I have now found out that my problem isn't just a select box in Zope, > > > but it is all form processing. > > > > > > I am mostly a PHP programmer so I am used to when you make a text field > > > in a form named e.g. Name it will (when you have hit the submit button > > > and the script you have set as actionscript receives the form) be > > > declared as a variable named Name. > > > > > > But I guess Zope doesn't work this way. > > > > > > So how does a dtml document recieve the fields in a form ? > > > > > > Regards, > > > > > > -- > > > ************************ > > > Gitte Wange Jensen > > > > > > System Squid Developer > > > MMManager Aps > > > +45 29 72 79 72 > > > > > > gitte@mmmanager.org > > > ************************ > > > > > > > > > _______________________________________________ > > > Zope maillist - Zope@zope.org > > > http://lists.zope.org/mailman/listinfo/zope > > > ** No cross posts or HTML encoding! ** > > > (Related lists - > > > http://lists.zope.org/mailman/listinfo/zope-announce > > > http://lists.zope.org/mailman/listinfo/zope-dev ) > > > > > > _______________________________________________ > > Zope maillist - Zope@zope.org > > http://lists.zope.org/mailman/listinfo/zope > > ** No cross posts or HTML encoding! ** > > (Related lists - > > http://lists.zope.org/mailman/listinfo/zope-announce > > http://lists.zope.org/mailman/listinfo/zope-dev ) > > > > -- > ************************ > Gitte Wange Jensen > > System Squid Developer > MMManager Aps > +45 29 72 79 72 > > gitte@mmmanager.org > ************************
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
-- ************************ Gitte Wange Jensen
System Squid Developer MMManager Aps +45 29 72 79 72
gitte@mmmanager.org ************************
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
You cannot nest dtml tags like that, this code will not work: <dtml-if expr="<dtml-var ActionList> == 1"> Do this <dtml-elif expr="<dtml-var ActionList> == 2"> Do that. ---------------------------------------------------- You can use the request object like so: <dtml-if expr="REQUEST['ActionList'] == 1"> Do this <dtml-elif expr="REQUEST['ActionList'] == 2"> Do that. or Just pull it out of the namespace: <dtml-if expr="ActionList == 1"> Do this <dtml-elif expr="ActionList == 2"> Do that. The last one is the code you psuedocode you used, surprise,surprise, it works!!!!!
Am Freitag, 30. März 2001 12:17 schrieben Sie:
So how does a dtml document recieve the fields in a form ?
This is a small code I use. The html-form field is named "einkauf_field". I use an Product called "Einkaufsliste", which has a ZClass "einkaufsliste_entry", which again has a property "artikel". The follwoing code is all you need to create an object with the content of the form. ---------- <dtml-call "REQUEST.set('artikel',einkauf_field)"> <dtml-with "manage_addProduct['Einkaufsliste']"> <dtml-call "einkaufsliste_entry_add(_.None, _)"> </dtml-with> ---------- hth, Jan -- Jan@MountainbikeHQ.de http://www.MountainbikeHQ.de - Your home for DH, DS and CC Mountainbiking
participants (7)
-
Gitte Wange -
Gitte Wange -
Jan Lentfer -
Karl Munroe -
Phil Harris -
Steve Drees -
Tino Wildenhain