Hi; I have a form that I need to send to a script and then send off to a URL (PayPal). I need to process it through the script to renumber things for PP. How do I do this? I imagine I add an element to the PT like so: <form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post"> but I need to pass a parameter "doc", which, of course, is the document I'm submitting. So I tried this: <form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post"> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" /> which renders my page fine, but throws an error when I submit the form: Cannot locate object at: http://example.com/s/c/x/j/en-us/s/renumberTheCart%28here What do I do? Also, where do I return the document? Can I re.sub the "form action" in my script to send it to a new place? Does it just refresh the original doc? TIA, Tony ________________________________________________________________________ AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com.
--On 13. August 2007 15:39:40 -0400 tonylabarbara@aol.com wrote:
Hi; I have a form that I need to send to a script and then send off to a URL (PayPal). I need to process it through the script to renumber things for PP. How do I do this? I imagine I add an element to the PT like so:
<form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post">
but I need to pass a parameter "doc", which, of course, is the document I'm submitting. So I tried this:
<form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post"> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />
You might check out the basics about HTML forms first. The 'action' parameter is an URL and *not* some Python-like function call. You specify the destination URL inside the action attribute and pass the parameters as *hidden* form parameters to the URL - either using method GET or POST. You'll find more on forms in any HTML tutorial. Start from here: <http://www.w3schools.com/html/html_forms.asp> -aj
No, it should work the way it is...that is a URL I passed. I changed it to an absolute URL just to double-check, and got basically the same error: Invalid request The parameter, doc, was omitted from the request. How do I pass the parameter, which in my case is quite long and stashed neatly away in a PT macro? <td tal:define="docs here/CheckOutAfterEditStuff"> <form action=http://example.com/s/renumberTheCart?doc=docs" method="post">? <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />? </td> TIA, Tony -----Original Message----- From: Andreas Jung <lists@zopyx.com> To: tonylabarbara@aol.com; zope@zope.org Sent: Mon, 13 Aug 2007 3:55 pm Subject: Re: [Zope] Form-Through-Script ? --On 13. August 2007 15:39:40 -0400 tonylabarbara@aol.com wrote:? ?
? Hi;? I have a form that I need to send to a script and then send off to a URL? (PayPal). I need to process it through the script to renumber things for? PP. How do I do this? I imagine I add an element to the PT like so:? ? <form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post">? ? but I need to pass a parameter "doc", which, of course, is the document? I'm submitting. So I tried this:? ? <form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post">? <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />? ? You might check out the basics about HTML forms first. The 'action' parameter is an URL and *not* some Python-like function call. You specify the destination URL inside the action attribute and pass the parameters as *hidden* form parameters to the URL - either using method GET or POST.? ? You'll find more on forms in any HTML tutorial. Start from here:? ? <http://www.w3schools.com/html/html_forms.asp>? ? -aj?
________________________________________________________________________ AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com.
I think you want: <form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post" enctype="multipart/form-data"> <td> <form action=http://example.com/s/renumberTheCart" method="post"> <input type="hidden" name="doc" value="" tal:attributes="value here/ CheckOutAfterEditStuff" /> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" /> </td> (my tal may be a bit off) On Aug 13, 2007, at 4:09 PM, tonylabarbara@aol.com wrote:
No, it should work the way it is...that is a URL I passed. I changed it to an absolute URL just to double-check, and got basically the same error:
Invalid request The parameter, doc, was omitted from the request.
How do I pass the parameter, which in my case is quite long and stashed neatly away in a PT macro?
<td tal:define="docs here/CheckOutAfterEditStuff"> <form action=http://example.com/s/renumberTheCart?doc=docs" method="post"> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" /> </td>
TIA, Tony
-----Original Message----- From: Andreas Jung <lists@zopyx.com> To: tonylabarbara@aol.com; zope@zope.org Sent: Mon, 13 Aug 2007 3:55 pm Subject: Re: [Zope] Form-Through-Script
--On 13. August 2007 15:39:40 -0400 tonylabarbara@aol.com wrote:
Hi; I have a form that I need to send to a script and then send off
to a URL
(PayPal). I need to process it through the script to renumber things for PP. How do I do this? I imagine I add an element to the PT like so:
<form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post">
but I need to pass a parameter "doc", which, of course, is the document I'm submitting. So I tried this:
<form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post"> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />
You might check out the basics about HTML forms first. The 'action' parameter is an URL and *not* some Python-like function call. You specify the destination URL inside the action attribute and pass the parameters as *hidden* form parameters to the URL - either using method GET or POST.
You'll find more on forms in any HTML tutorial. Start from here:
<http://www.w3schools.com/html/html_forms.asp>
-aj AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com. _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Well it didn't like that, either: Invalid request The parameter, doc, was omitted from the request. again. But look here: <td tal:define="docs here/CheckOutAfterEditStuff"> <form action="renumberTheCart(docs)" method="post" enctype="multipart/form-data"> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" /> See, I have a definition of "docs", but it's not pointing to a "use-macro" widget. Must be the problem, but how do I do that? TIA, Tony -----Original Message----- From: Tom Von Lahndorff <tom@modscape.com> To: tonylabarbara@aol.com Cc: lists@zopyx.com; zope@zope.org Sent: Mon, 13 Aug 2007 4:20 pm Subject: Re: [Zope] Form-Through-Script I think you want: <form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post" enctype="multipart/form-data"> <td> <form action=http://example.com/s/renumberTheCart" method="post"> <input type="hidden" name="doc" value="" tal:attributes="value here/CheckOutAfterEditStuff" />? <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />? </td> (my tal may be a bit off) On Aug 13, 2007, at 4:09 PM, tonylabarbara@aol.com wrote: No, it should work the way it is...that is a URL I passed. I changed it to an absolute URL just to double-check, and got basically the same error: ? Invalid request The parameter, doc, was omitted from the request. How do I pass the parameter, which in my case is quite long and stashed neatly away in a PT macro? <td tal:define="docs here/CheckOutAfterEditStuff"> <form action=http://example.com/s/renumberTheCart?doc=docs" method="post">? <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />? </td> TIA, Tony -----Original Message----- From: Andreas Jung <lists@zopyx.com> To: tonylabarbara@aol.com; zope@zope.org Sent: Mon, 13 Aug 2007 3:55 pm Subject: Re: [Zope] Form-Through-Script ? --On 13. August 2007 15:39:40 -0400 tonylabarbara@aol.com wrote:? ?
? Hi;? I have a form that I need to send to a script and then send off to a URL? (PayPal). I need to process it through the script to renumber things for? PP. How do I do this? I imagine I add an element to the PT like so:? ? <form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post">? ? but I need to pass a parameter "doc", which, of course, is the document? I'm submitting. So I tried this:? ? <form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post">? <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />? ? You might check out the basics about HTML forms first. The 'action' parameter is an URL and *not* some Python-like function call. You specify the destination URL inside the action attribute and pass the parameters as *hidden* form parameters to the URL - either using method GET or POST.? ? You'll find more on forms in any HTML tutorial. Start from here:? ? <http://www.w3schools.com/html/html_forms.asp>? ? -aj?
AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com. _______________________________________________ Zope maillist? -? Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** ? No cross posts or HTML encoding!? ** (Related lists -? ?http://mail.zope.org/mailman/listinfo/zope-announce ?http://mail.zope.org/mailman/listinfo/zope-dev ) = ________________________________________________________________________ AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com.
can you describe what you're trying to do a little more clearly? On Aug 13, 2007, at 4:29 PM, tonylabarbara@aol.com wrote:
Well it didn't like that, either:
Invalid request The parameter, doc, was omitted from the request.
again. But look here:
<td tal:define="docs here/CheckOutAfterEditStuff"> <form action="renumberTheCart(docs)" method="post" enctype="multipart/form-data"> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />
See, I have a definition of "docs", but it's not pointing to a "use- macro" widget. Must be the problem, but how do I do that? TIA, Tony
-----Original Message----- From: Tom Von Lahndorff <tom@modscape.com> To: tonylabarbara@aol.com Cc: lists@zopyx.com; zope@zope.org Sent: Mon, 13 Aug 2007 4:20 pm Subject: Re: [Zope] Form-Through-Script
I think you want:
<form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post" enctype="multipart/form-data"> <td> <form action=http://example.com/s/renumberTheCart" method="post"> <input type="hidden" name="doc" value="" tal:attributes="value here/ CheckOutAfterEditStuff" /> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" /> </td>
(my tal may be a bit off)
On Aug 13, 2007, at 4:09 PM, tonylabarbara@aol.com wrote:
No, it should work the way it is...that is a URL I passed. I changed it to an absolute URL just to double-check, and got basically the same error:
Invalid request The parameter, doc, was omitted from the request.
How do I pass the parameter, which in my case is quite long and stashed neatly away in a PT macro?
<td tal:define="docs here/CheckOutAfterEditStuff"> <form action=http://example.com/s/renumberTheCart?doc=docs" method="post"> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" /> </td>
TIA, Tony
-----Original Message----- From: Andreas Jung <lists@zopyx.com> To: tonylabarbara@aol.com; zope@zope.org Sent: Mon, 13 Aug 2007 3:55 pm Subject: Re: [Zope] Form-Through-Script
--On 13. August 2007 15:39:40 -0400 tonylabarbara@aol.com wrote:
Hi; I have a form that I need to send to a script and then send off
to a URL
(PayPal). I need to process it through the script to renumber things for PP. How do I do this? I imagine I add an element to the PT like so:
<form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post">
but I need to pass a parameter "doc", which, of course, is the document I'm submitting. So I tried this:
<form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post"> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />
You might check out the basics about HTML forms first. The 'action' parameter is an URL and *not* some Python-like function call. You specify the destination URL inside the action attribute and pass the parameters as *hidden* form parameters to the URL - either using method GET or POST.
You'll find more on forms in any HTML tutorial. Start from here:
<http://www.w3schools.com/html/html_forms.asp>
-aj AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com. _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
=
I'm trying to make a silk purse out of a pig's ear :) I have a form where purchasers can deselect items they've added to their shopping cart. All the hidden fields have been numbered according to the items they *originally* selected. If they deselect an item, then it will probably necessitate a renumbering of all those hidden fields, since PayPal doesn't tolerate misnumbering: everything must be numbered "1" for all the hidden fields of the first product, "2" for the second, etc. If the customer selects 5 products and deletes the 3rd, then I need to renumber. I wrote a script that can do that. Now, I have to send the form to that script, with all its lovely hidden fields, then reproduce it somewhere so I can send it off to PP. That is, the form must return from the called script to a new page and deliver all the renumbered hidden fields. TIA, Tony -----Original Message----- From: Tom Von Lahndorff <tom@modscape.com> To: tonylabarbara@aol.com Cc: lists@zopyx.com; zope@zope.org Sent: Mon, 13 Aug 2007 4:59 pm Subject: Re: [Zope] Form-Through-Script can you describe what you're trying to do a little more clearly? On Aug 13, 2007, at 4:29 PM, tonylabarbara@aol.com wrote: Well it didn't like that, either: ? Invalid request The parameter, doc, was omitted from the request. again. But look here: <td tal:define="docs here/CheckOutAfterEditStuff"> <form action="renumberTheCart(docs)" method="post" enctype="multipart/form-data"> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" /> See, I have a definition of "docs", but it's not pointing to a "use-macro" widget. Must be the problem, but how do I do that? TIA, Tony -----Original Message----- From: Tom Von Lahndorff <tom@modscape.com> To: tonylabarbara@aol.com Cc: lists@zopyx.com; zope@zope.org Sent: Mon, 13 Aug 2007 4:20 pm Subject: Re: [Zope] Form-Through-Script I think you want: <form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post" enctype="multipart/form-data"> <td> <form action=http://example.com/s/renumberTheCart" method="post"> <input type="hidden" name="doc" value="" tal:attributes="value here/CheckOutAfterEditStuff" />? <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />? </td> (my tal may be a bit off) On Aug 13, 2007, at 4:09 PM, tonylabarbara@aol.com wrote: No, it should work the way it is...that is a URL I passed. I changed it to an absolute URL just to double-check, and got basically the same error: ? Invalid request The parameter, doc, was omitted from the request. How do I pass the parameter, which in my case is quite long and stashed neatly away in a PT macro? <td tal:define="docs here/CheckOutAfterEditStuff"> <form action=http://example.com/s/renumberTheCart?doc=docs" method="post">? <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />? </td> TIA, Tony -----Original Message----- From: Andreas Jung <lists@zopyx.com> To: tonylabarbara@aol.com; zope@zope.org Sent: Mon, 13 Aug 2007 3:55 pm Subject: Re: [Zope] Form-Through-Script ? --On 13. August 2007 15:39:40 -0400 tonylabarbara@aol.com wrote:? ?
? Hi;? I have a form that I need to send to a script and then send off to a URL? (PayPal). I need to process it through the script to renumber things for? PP. How do I do this? I imagine I add an element to the PT like so:? ? <form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post">? ? but I need to pass a parameter "doc", which, of course, is the document? I'm submitting. So I tried this:? ? <form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post">? <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />? ? You might check out the basics about HTML forms first. The 'action' parameter is an URL and *not* some Python-like function call. You specify the destination URL inside the action attribute and pass the parameters as *hidden* form parameters to the URL - either using method GET or POST.? ? You'll find more on forms in any HTML tutorial. Start from here:? ? <http://www.w3schools.com/html/html_forms.asp>? ? -aj?
AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com. _______________________________________________ Zope maillist? -? Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** ? No cross posts or HTML encoding!? ** (Related lists -? ?http://mail.zope.org/mailman/listinfo/zope-announce ?http://mail.zope.org/mailman/listinfo/zope-dev ) = = ________________________________________________________________________ AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com.
Sounds like the script should check to see if the user is removing something like: <input type="checkbox" name="remove" value="item-374623746"> if remove remove the item redirect back to the udpated form page else send to PP this way once the item is removed and the same script is called, since there's no remove this time, it'll go to PP. On Aug 13, 2007, at 5:14 PM, tonylabarbara@aol.com wrote:
I'm trying to make a silk purse out of a pig's ear :) I have a form where purchasers can deselect items they've added to their shopping cart. All the hidden fields have been numbered according to the items they *originally* selected. If they deselect an item, then it will probably necessitate a renumbering of all those hidden fields, since PayPal doesn't tolerate misnumbering: everything must be numbered "1" for all the hidden fields of the first product, "2" for the second, etc. If the customer selects 5 products and deletes the 3rd, then I need to renumber. I wrote a script that can do that. Now, I have to send the form to that script, with all its lovely hidden fields, then reproduce it somewhere so I can send it off to PP. That is, the form must return from the called script to a new page and deliver all the renumbered hidden fields. TIA, Tony
-----Original Message----- From: Tom Von Lahndorff <tom@modscape.com> To: tonylabarbara@aol.com Cc: lists@zopyx.com; zope@zope.org Sent: Mon, 13 Aug 2007 4:59 pm Subject: Re: [Zope] Form-Through-Script
can you describe what you're trying to do a little more clearly?
On Aug 13, 2007, at 4:29 PM, tonylabarbara@aol.com wrote:
Well it didn't like that, either:
Invalid request The parameter, doc, was omitted from the request.
again. But look here:
<td tal:define="docs here/CheckOutAfterEditStuff"> <form action="renumberTheCart(docs)" method="post" enctype="multipart/form-data"> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />
See, I have a definition of "docs", but it's not pointing to a "use-macro" widget. Must be the problem, but how do I do that? TIA, Tony
-----Original Message----- From: Tom Von Lahndorff <tom@modscape.com> To: tonylabarbara@aol.com Cc: lists@zopyx.com; zope@zope.org Sent: Mon, 13 Aug 2007 4:20 pm Subject: Re: [Zope] Form-Through-Script
I think you want:
<form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post" enctype="multipart/form-data"> <td> <form action=http://example.com/s/renumberTheCart" method="post"> <input type="hidden" name="doc" value="" tal:attributes="value here/CheckOutAfterEditStuff" /> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" /> </td>
(my tal may be a bit off)
On Aug 13, 2007, at 4:09 PM, tonylabarbara@aol.com wrote:
No, it should work the way it is...that is a URL I passed. I changed it to an absolute URL just to double-check, and got basically the same error:
Invalid request The parameter, doc, was omitted from the request.
How do I pass the parameter, which in my case is quite long and stashed neatly away in a PT macro?
<td tal:define="docs here/CheckOutAfterEditStuff"> <form action=http://example.com/s/renumberTheCart?doc=docs" method="post"> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" /> </td>
TIA, Tony
-----Original Message----- From: Andreas Jung <lists@zopyx.com> To: tonylabarbara@aol.com; zope@zope.org Sent: Mon, 13 Aug 2007 3:55 pm Subject: Re: [Zope] Form-Through-Script
--On 13. August 2007 15:39:40 -0400 tonylabarbara@aol.com wrote:
Hi; I have a form that I need to send to a script and then send off
to a URL
(PayPal). I need to process it through the script to renumber things for PP. How do I do this? I imagine I add an element to the PT like so:
<form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post">
but I need to pass a parameter "doc", which, of course, is the document I'm submitting. So I tried this:
<form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post"> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />
You might check out the basics about HTML forms first. The 'action' parameter is an URL and *not* some Python-like function call. You specify the destination URL inside the action attribute and pass the parameters as *hidden* form parameters to the URL - either using method GET or POST.
You'll find more on forms in any HTML tutorial. Start from here:
<http://www.w3schools.com/html/html_forms.asp>
-aj AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com. _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
=
=
I would LOVE to do that. I don't know how :( Can you point me to a good tutorial or explain this a bit and give me some KW to chase down in google? TIA, Tony -----Original Message----- From: Tom Von Lahndorff <tom@modscape.com> To: tonylabarbara@aol.com Cc: lists@zopyx.com; zope@zope.org Sent: Mon, 13 Aug 2007 5:35 pm Subject: Re: [Zope] Form-Through-Script Sounds like the script should check to see if the user is removing something like: <input type="checkbox" name="remove" value="item-374623746"> if remove remove the item redirect back to the udpated form page else send to PP this way once the item is removed and the same script is called, since there's no remove this time, it'll go to PP. On Aug 13, 2007, at 5:14 PM, tonylabarbara@aol.com wrote: I'm trying to make a silk purse out of a pig's ear :) I have a form where purchasers can deselect items they've added to their shopping cart. All the hidden fields have been numbered according to the items they *originally* selected. If they deselect an item, then it will probably necessitate a renumbering of all those hidden fields, since PayPal doesn't tolerate misnumbering: everything must be numbered "1" for all the hidden fields of the first product, "2" for the second, etc. If the customer selects 5 products and deletes the 3rd, then I need to renumber. I wrote a script that can do that. Now, I have to send the form to that script, with all its lovely hidden fields, then reproduce it somewhere so I can send it off to PP. That is, the form must return from the called script to a new page and deliver all the renumbered hidden fields. TIA, Tony -----Original Message----- From: Tom Von Lahndorff <tom@modscape.com> To: tonylabarbara@aol.com Cc: lists@zopyx.com; zope@zope.org Sent: Mon, 13 Aug 2007 4:59 pm Subject: Re: [Zope] Form-Through-Script can you describe what you're trying to do a little more clearly? On Aug 13, 2007, at 4:29 PM, tonylabarbara@aol.com wrote: Well it didn't like that, either: ? Invalid request The parameter, doc, was omitted from the request. again. But look here: <td tal:define="docs here/CheckOutAfterEditStuff"> <form action="renumberTheCart(docs)" method="post" enctype="multipart/form-data"> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" /> See, I have a definition of "docs", but it's not pointing to a "use-macro" widget. Must be the problem, but how do I do that? TIA, Tony -----Original Message----- From: Tom Von Lahndorff <tom@modscape.com> To: tonylabarbara@aol.com Cc: lists@zopyx.com; zope@zope.org Sent: Mon, 13 Aug 2007 4:20 pm Subject: Re: [Zope] Form-Through-Script I think you want: <form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post" enctype="multipart/form-data"> <td> <form action=http://example.com/s/renumberTheCart" method="post"> <input type="hidden" name="doc" value="" tal:attributes="value here/CheckOutAfterEditStuff" />? <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />? </td> (my tal may be a bit off) On Aug 13, 2007, at 4:09 PM, tonylabarbara@aol.com wrote: No, it should work the way it is...that is a URL I passed. I changed it to an absolute URL just to double-check, and got basically the same error: ? Invalid request The parameter, doc, was omitted from the request. How do I pass the parameter, which in my case is quite long and stashed neatly away in a PT macro? <td tal:define="docs here/CheckOutAfterEditStuff"> <form action=http://example.com/s/renumberTheCart?doc=docs" method="post">? <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />? </td> TIA, Tony -----Original Message----- From: Andreas Jung <lists@zopyx.com> To: tonylabarbara@aol.com; zope@zope.org Sent: Mon, 13 Aug 2007 3:55 pm Subject: Re: [Zope] Form-Through-Script ? --On 13. August 2007 15:39:40 -0400 tonylabarbara@aol.com wrote:? ?
? Hi;? I have a form that I need to send to a script and then send off to a URL? (PayPal). I need to process it through the script to renumber things for? PP. How do I do this? I imagine I add an element to the PT like so:? ? <form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post">? ? but I need to pass a parameter "doc", which, of course, is the document? I'm submitting. So I tried this:? ? <form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post">? <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />? ? You might check out the basics about HTML forms first. The 'action' parameter is an URL and *not* some Python-like function call. You specify the destination URL inside the action attribute and pass the parameters as *hidden* form parameters to the URL - either using method GET or POST.? ? You'll find more on forms in any HTML tutorial. Start from here:? ? <http://www.w3schools.com/html/html_forms.asp>? ? -aj?
AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com. _______________________________________________ Zope maillist? -? Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** ? No cross posts or HTML encoding!? ** (Related lists -? ?http://mail.zope.org/mailman/listinfo/zope-announce ?http://mail.zope.org/mailman/listinfo/zope-dev ) = = = ________________________________________________________________________ AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com.
--On 13. August 2007 17:40:35 -0400 tonylabarbara@aol.com wrote:
I would LOVE to do that. I don't know how :( Can you point me to a good tutorial or explain this a bit and give me some KW to chase down in google?
Tony, please think about what you're doing for a moment. If you want to call a method or a script XXX inside Zope through a form where the method expects parameters A and B then you have to write: <form action="XXX" method="get|post"> <input type="hidden" name="A" tal:attributes="value context/some_method_providing_a" /> <input type="hidden" name="B" tal:attributes="value context/some_method_providing_b" /> Now apply this knowledge to your usecase. Check your _generated_ code twice if all requirements are fulfilled. -aj
I don't think I've misunderstood you and I have done what I believe I understand you to say. I can't check the browser (generated)?code because I get an error stating I haven't passed the requisite variable to the script. The variable is the entire document, or at least the hidden variables. They aren't being passed to the script and I don't know how to do that. I have a form where purchasers can deselect items they've added to their shopping cart. All the hidden fields have been numbered according to the items they *originally* selected. If they deselect an item, then it will probably necessitate a renumbering of all those hidden fields, since PayPal doesn't tolerate misnumbering: everything must be numbered "1" for all the hidden fields of the first product, "2" for the second, etc. If the customer selects 5 products and deletes the 3rd, then I need to renumber. I wrote a script that can do that. Now, I have to send the form to that script, with all its lovely hidden fields, then reproduce it somewhere so I can send it off to PP. That is, the form must return from the called script to a new page and deliver all the renumbered hidden fields. Let me summarize what I've written before to put in one post exactly what's going on: 1)?I have a form that I need to send to a script and then send off to a URL (PayPal). I need to process it through the script to renumber things for PP. How do I do this? I imagine I add an element to the PT like so: <form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post"> but I need to pass a parameter "doc", which, of course, is the document I'm submitting. So I tried this: <form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post"> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" /> which renders my page fine, but throws an error when I submit the form: Cannot locate object at: http://example.com/s/c/x/j/en-us/s/renumberTheCart%28here 2) I changed it to an absolute URL just to double-check, and got basically the same error: ? Invalid request The parameter, doc, was omitted from the request. How do I pass the parameter, which in my case is quite long and stashed neatly away in a PT macro? <td tal:define="docs here/CheckOutAfterEditStuff"> <form action=http://example.com/s/renumberTheCart?doc=docs" method="post">? <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />? </td> Now, Tom Von Lahndorff suggested the following: Sounds like the script should check to see if the user is removing something like: <input type="checkbox" name="remove" value="item-374623746"> if remove remove the item redirect back to the udpated form page else send to PP this way once the item is removed and the same script is called, since there's no remove this time, it'll go to PP. I would LOVE to do that...if I knew how! Any ideas? TIA, Tony -----Original Message----- From: Andreas Jung <lists@zopyx.com> To: tonylabarbara@aol.com; tom@modscape.com Cc: lists@zopyx.com; zope@zope.org Sent: Tue, 14 Aug 2007 12:43 am Subject: Re: [Zope] Form-Through-Script ? Invalid request The parameter, doc, was omitted from the request. How do I pass the parameter, which in my case is quite long and stashed neatly away in a PT macro? <td tal:define="docs here/CheckOutAfterEditStuff"> <form action=http://example.com/s/renumberTheCart?doc=docs" method="post">? <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />? </td> Now, Tom Von Lahndorff suggested the following: Sounds like the script should check to see if the user is removing something like: <input type="checkbox" name="remove" value="item-374623746"> if remove remove the item redirect back to the udpated form page else send to PP this way once the item is removed and the same script is called, since there's no remove this time, it'll go to PP. I would LOVE to do that...if I knew how! Any ideas? TIA, Tony -----Original Message----- From: Andreas Jung <lists@zopyx.com> To: tonylabarbara@aol.com; tom@modscape.com Cc: lists@zopyx.com; zope@zope.org Sent: Tue, 14 Aug 2007 12:43 am Subject: Re: [Zope] Form-Through-Script ? --On 13. August 2007 17:40:35 -0400 tonylabarbara@aol.com wrote:? ?
? I would LOVE to do that. I don't know how :( Can you point me to a good? tutorial or explain this a bit and give me some KW to chase down in? google?? ? ? Tony, please think about what you're doing for a moment.? ? If you want to call a method or a script XXX inside Zope through a form? where the method expects parameters A and B then you have to write:? ? <form action="XXX" method="get|post">? ? <input type="hidden" name="A" tal:attributes="value context/some_method_providing_a" />? <input type="hidden" name="B" tal:attributes="value context/some_method_providing_b" />? ? Now apply this knowledge to your usecase. Check your _generated_? code twice if all requirements are fulfilled.? ? -aj? ?
________________________________________________________________________ AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com.
tonylabarbara@aol.com wrote:
1)?I have a form that I need to send to a script and then send off to a URL (PayPal). I need to process it through the script to renumber things for PP. How do I do this? I imagine I add an element to the PT like so:
<form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post">
This action is rubbish. I have no idea what you're trying to do.
but I need to pass a parameter "doc", which, of course, is the document I'm submitting. So I tried this:
<form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post"> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />
What's this macro got in it?
which renders my page fine, but throws an error when I submit the form:
Cannot locate object at: http://example.com/s/c/x/j/en-us/s/renumberTheCart%28here
Exactly, you've made up your own syntax there, so no wonder it doesn't work ;-)
2) I changed it to an absolute URL just to double-check, and got basically the same error: ?
Changed what to what?
Invalid request
The parameter, doc, was omitted from the request.
I think you quoted the code for this earlier in the thread, it was attempting to use a query string parameter as part of a form action. That *does not work*, nothing to do with Zope, that's just html. You need to put doc as a variable in the form: <td tal:define="docs here/CheckOutAfterEditStuff"> <form action=http://example.com/s/renumberTheCart" method="post"> <input type="whatever" name="doc" value="whatever"/> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" /> </td> I have no idea what the tal:define is supposed to do there...
this way once the item is removed and the same script is called, since there's no remove this time, it'll go to PP.
I would LOVE to do that...if I knew how! Any ideas?
Learn to crawl before you attempt walking, let alone running... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
or maybe you have an "update" page where you remove items and then a "confirm" page where you can send to PP? On Aug 13, 2007, at 5:14 PM, tonylabarbara@aol.com wrote:
I'm trying to make a silk purse out of a pig's ear :) I have a form where purchasers can deselect items they've added to their shopping cart. All the hidden fields have been numbered according to the items they *originally* selected. If they deselect an item, then it will probably necessitate a renumbering of all those hidden fields, since PayPal doesn't tolerate misnumbering: everything must be numbered "1" for all the hidden fields of the first product, "2" for the second, etc. If the customer selects 5 products and deletes the 3rd, then I need to renumber. I wrote a script that can do that. Now, I have to send the form to that script, with all its lovely hidden fields, then reproduce it somewhere so I can send it off to PP. That is, the form must return from the called script to a new page and deliver all the renumbered hidden fields. TIA, Tony
-----Original Message----- From: Tom Von Lahndorff <tom@modscape.com> To: tonylabarbara@aol.com Cc: lists@zopyx.com; zope@zope.org Sent: Mon, 13 Aug 2007 4:59 pm Subject: Re: [Zope] Form-Through-Script
can you describe what you're trying to do a little more clearly?
On Aug 13, 2007, at 4:29 PM, tonylabarbara@aol.com wrote:
Well it didn't like that, either:
Invalid request The parameter, doc, was omitted from the request.
again. But look here:
<td tal:define="docs here/CheckOutAfterEditStuff"> <form action="renumberTheCart(docs)" method="post" enctype="multipart/form-data"> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />
See, I have a definition of "docs", but it's not pointing to a "use-macro" widget. Must be the problem, but how do I do that? TIA, Tony
-----Original Message----- From: Tom Von Lahndorff <tom@modscape.com> To: tonylabarbara@aol.com Cc: lists@zopyx.com; zope@zope.org Sent: Mon, 13 Aug 2007 4:20 pm Subject: Re: [Zope] Form-Through-Script
I think you want:
<form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post" enctype="multipart/form-data"> <td> <form action=http://example.com/s/renumberTheCart" method="post"> <input type="hidden" name="doc" value="" tal:attributes="value here/CheckOutAfterEditStuff" /> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" /> </td>
(my tal may be a bit off)
On Aug 13, 2007, at 4:09 PM, tonylabarbara@aol.com wrote:
No, it should work the way it is...that is a URL I passed. I changed it to an absolute URL just to double-check, and got basically the same error:
Invalid request The parameter, doc, was omitted from the request.
How do I pass the parameter, which in my case is quite long and stashed neatly away in a PT macro?
<td tal:define="docs here/CheckOutAfterEditStuff"> <form action=http://example.com/s/renumberTheCart?doc=docs" method="post"> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" /> </td>
TIA, Tony
-----Original Message----- From: Andreas Jung <lists@zopyx.com> To: tonylabarbara@aol.com; zope@zope.org Sent: Mon, 13 Aug 2007 3:55 pm Subject: Re: [Zope] Form-Through-Script
--On 13. August 2007 15:39:40 -0400 tonylabarbara@aol.com wrote:
Hi; I have a form that I need to send to a script and then send off
to a URL
(PayPal). I need to process it through the script to renumber things for PP. How do I do this? I imagine I add an element to the PT like so:
<form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post">
but I need to pass a parameter "doc", which, of course, is the document I'm submitting. So I tried this:
<form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post"> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />
You might check out the basics about HTML forms first. The 'action' parameter is an URL and *not* some Python-like function call. You specify the destination URL inside the action attribute and pass the parameters as *hidden* form parameters to the URL - either using method GET or POST.
You'll find more on forms in any HTML tutorial. Start from here:
<http://www.w3schools.com/html/html_forms.asp>
-aj AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com. _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
=
=
That is *exactly* what I'm trying to do. But again, I can't send the parameter to the script, which in this case, is the entire document. Please see the other post I'm sending up right now. TIA, Tony -----Original Message----- From: Tom Von Lahndorff <tom@modscape.com> To: tonylabarbara@aol.com Cc: lists@zopyx.com; zope@zope.org Sent: Mon, 13 Aug 2007 5:38 pm Subject: Re: [Zope] Form-Through-Script or maybe you have an "update" page where you remove items and then a "confirm" page where you can send to PP? On Aug 13, 2007, at 5:14 PM, tonylabarbara@aol.com wrote: I'm trying to make a silk purse out of a pig's ear :) I have a form where purchasers can deselect items they've added to their shopping cart. All the hidden fields have been numbered according to the items they *originally* selected. If they deselect an item, then it will probably necessitate a renumbering of all those hidden fields, since PayPal doesn't tolerate misnumbering: everything must be numbered "1" for all the hidden fields of the first product, "2" for the second, etc. If the customer selects 5 products and deletes the 3rd, then I need to renumber. I wrote a script that can do that. Now, I have to send the form to that script, with all its lovely hidden fields, then reproduce it somewhere so I can send it off to PP. That is, the form must return from the called script to a new page and deliver all the renumbered hidden fields. TIA, Tony -----Original Message----- From: Tom Von Lahndorff <tom@modscape.com> To: tonylabarbara@aol.com Cc: lists@zopyx.com; zope@zope.org Sent: Mon, 13 Aug 2007 4:59 pm Subject: Re: [Zope] Form-Through-Script can you describe what you're trying to do a little more clearly? On Aug 13, 2007, at 4:29 PM, tonylabarbara@aol.com wrote: Well it didn't like that, either: ? Invalid request The parameter, doc, was omitted from the request. again. But look here: <td tal:define="docs here/CheckOutAfterEditStuff"> <form action="renumberTheCart(docs)" method="post" enctype="multipart/form-data"> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" /> See, I have a definition of "docs", but it's not pointing to a "use-macro" widget. Must be the problem, but how do I do that? TIA, Tony -----Original Message----- From: Tom Von Lahndorff <tom@modscape.com> To: tonylabarbara@aol.com Cc: lists@zopyx.com; zope@zope.org Sent: Mon, 13 Aug 2007 4:20 pm Subject: Re: [Zope] Form-Through-Script I think you want: <form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post" enctype="multipart/form-data"> <td> <form action=http://example.com/s/renumberTheCart" method="post"> <input type="hidden" name="doc" value="" tal:attributes="value here/CheckOutAfterEditStuff" />? <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />? </td> (my tal may be a bit off) On Aug 13, 2007, at 4:09 PM, tonylabarbara@aol.com wrote: No, it should work the way it is...that is a URL I passed. I changed it to an absolute URL just to double-check, and got basically the same error: ? Invalid request The parameter, doc, was omitted from the request. How do I pass the parameter, which in my case is quite long and stashed neatly away in a PT macro? <td tal:define="docs here/CheckOutAfterEditStuff"> <form action=http://example.com/s/renumberTheCart?doc=docs" method="post">? <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />? </td> TIA, Tony -----Original Message----- From: Andreas Jung <lists@zopyx.com> To: tonylabarbara@aol.com; zope@zope.org Sent: Mon, 13 Aug 2007 3:55 pm Subject: Re: [Zope] Form-Through-Script ? --On 13. August 2007 15:39:40 -0400 tonylabarbara@aol.com wrote:? ?
? Hi;? I have a form that I need to send to a script and then send off to a URL? (PayPal). I need to process it through the script to renumber things for? PP. How do I do this? I imagine I add an element to the PT like so:? ? <form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post">? ? but I need to pass a parameter "doc", which, of course, is the document? I'm submitting. So I tried this:? ? <form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post">? <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />? ? You might check out the basics about HTML forms first. The 'action' parameter is an URL and *not* some Python-like function call. You specify the destination URL inside the action attribute and pass the parameters as *hidden* form parameters to the URL - either using method GET or POST.? ? You'll find more on forms in any HTML tutorial. Start from here:? ? <http://www.w3schools.com/html/html_forms.asp>? ? -aj?
AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com. _______________________________________________ Zope maillist? -? Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** ? No cross posts or HTML encoding!? ** (Related lists -? ?http://mail.zope.org/mailman/listinfo/zope-announce ?http://mail.zope.org/mailman/listinfo/zope-dev ) = = = ________________________________________________________________________ AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com.
On Aug 13, 2007, at 3:55 PM, Andreas Jung wrote:
--On 13. August 2007 15:39:40 -0400 tonylabarbara@aol.com wrote:
Hi; I have a form that I need to send to a script and then send off to a URL (PayPal). I need to process it through the script to renumber things for PP. How do I do this? I imagine I add an element to the PT like so:
<form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post">
but I need to pass a parameter "doc", which, of course, is the document I'm submitting. So I tried this:
<form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post"> <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />
You might check out the basics about HTML forms first. The 'action' parameter is an URL and *not* some Python-like function call. You specify the destination URL inside the action attribute and pass the parameters as *hidden* form parameters to the URL - either using method GET or POST.
You'll find more on forms in any HTML tutorial. Start from here:
If you're uploading a file you'll want to also add enctype="multipart/ form-data" to the form tag. I usually add it by default. http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4 "The content type "application/x-www-form-urlencoded" is inefficient for sending large quantities of binary data or text containing non- ASCII characters. The content type "multipart/form-data" should be used for submitting forms that contain files, non-ASCII data, and binary data."
-aj _______________________________________________ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
multipart/form-data The content-type, right? That threw this error: Compilation failed xml.parsers.expat.ExpatError: unbound prefix: line 1, column 0 TIA, Tony -----Original Message----- From: Tom Von Lahndorff <tom@modscape.com> To: Andreas Jung <lists@zopyx.com> Cc: tonylabarbara@aol.com; zope@zope.org Sent: Mon, 13 Aug 2007 4:15 pm Subject: Re: [Zope] Form-Through-Script On Aug 13, 2007, at 3:55 PM, Andreas Jung wrote:? ?
? ? --On 13. August 2007 15:39:40 -0400 tonylabarbara@aol.com wrote:? ?
? Hi;? I have a form that I need to send to a script and then send off to >> a URL? (PayPal). I need to process it through the script to renumber >> things for? PP. How do I do this? I imagine I add an element to the PT like so:? ? <form action="renumberTheCart(here/CheckOutAfterEditStuff)" >> method="post">? ? but I need to pass a parameter "doc", which, of course, is the >> document? I'm submitting. So I tried this:? ? <form action="renumberTheCart(here/CheckOutAfterEditStuff)" >> method="post">? <p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" />? ? You might check out the basics about HTML forms first. The 'action' > parameter is an URL and *not* some Python-like function call. You > specify the destination URL inside the action attribute and pass > the parameters as *hidden* form parameters to the URL - either > using method GET or POST.? ? You'll find more on forms in any HTML tutorial. Start from here:? ? <http://www.w3schools.com/html/html_forms.asp>? ? ? If you're uploading a file you'll want to also add enctype="multipart/form-data" to the form tag. I usually add it by default.? ? http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4? "The content type "application/x-www-form-urlencoded" is inefficient for sending large quantities of binary data or text containing non-ASCII characters. The content type "multipart/form-data" should be used for submitting forms that contain files, non-ASCII data, and binary data."? ? ? -aj? _______________________________________________? Zope maillist - Zope@zope.org? http://mail.zope.org/mailman/listinfo/zope? ** No cross posts or HTML encoding! **? (Related lists -? http://mail.zope.org/mailman/listinfo/zope-announce? http://mail.zope.org/mailman/listinfo/zope-dev )? ?
________________________________________________________________________ AOL now offers free email to everyone. Find out more about what's free from AOL at AOL.com.
participants (4)
-
Andreas Jung -
Chris Withers -
Tom Von Lahndorff -
tonylabarbara@aol.com