<div>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. <br>
<br>
</div>
<div>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. </div>
<div> </div>
<div>Let me summarize what I've written before to put in one post exactly what's going on:</div>
<div><br>
1) <FONT size=2>I </FONT><FONT face="Times New Roman"><FONT size=3>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:<br>
<br>
<form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post"><br>
<br>
but I need to pass a parameter "doc", which, of course, is the document I'm submitting. So I tried this:<br>
<br>
<form action="renumberTheCart(here/CheckOutAfterEditStuff)" method="post"><br>
<p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" /><br>
<br>
which renders my page fine, but throws an error when I submit the form:<br>
<br>
Cannot locate object at: http://example.com/s/c/x/j/en-us/s/renumberTheCart%28here<br>
</FONT><br>
<br>
2) I changed it to an absolute URL just to double-check, and got basically the same error:</div>
<div> </div>
<div><STRONG>Invalid request</STRONG></div>
<div>The parameter, <EM>doc</EM>, was omitted from the request. </div>
<div><br>
How do I pass the parameter, which in my case is quite long and stashed neatly away in a PT macro?<br>
<br>
<td tal:define="docs here/CheckOutAfterEditStuff"><br>
<form action=<A href="http://example.com/s/renumberTheCart?doc=docs" target=_blank>http://example.com/s/renumberTheCart?doc=docs</A>" method="post"> <br>
<p metal:use-macro="here/CheckOutAfterEditStuff/macros/main" /> <br>
</td><br>
<br>
<br>
Now, Tom Von Lahndorff suggested the following:<br>
<br>
<div>Sounds like the script should check to see if the user is removing something like:</div>
<div><input type="checkbox" name="remove" value="item-374623746"></div>
<div><BR class=khtml-block-placeholder></div>
<div>if remove</div>
<div>remove the item</div>
<div>redirect back to the udpated form page</div>
<div>else</div>
<div>send to PP</div>
<div><BR class=khtml-block-placeholder></div>
<div>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.</div>
<br>
<br>
I would LOVE to do that...if I knew how! Any ideas?<br>
TIA,<br>
Tony</div>
<div></FONT><br>
<br>
<br>
-----Original Message-----<br>
From: Andreas Jung <lists@zopyx.com><br>
To: tonylabarbara@aol.com; tom@modscape.com<br>
Cc: lists@zopyx.com; zope@zope.org<br>
Sent: Tue, 14 Aug 2007 12:43 am<br>
Subject: Re: [Zope] Form-Through-Script<br>
<br>
</div>
<div id=AOLMsgPart_1_c735e037-7cbd-4a9e-bba4-902a2437fcaa style="FONT-SIZE: 12px; MARGIN: 0px; COLOR: #000; FONT-FAMILY: Tahoma, Verdana, Arial, Sans-Serif; BACKGROUND-COLOR: #fff"> <br>
--On 13. August 2007 17:40:35 -0400 <A href="mailto:tonylabarbara@aol.com">tonylabarbara@aol.com</A> wrote: <br>
<br>
> <br>
> I would LOVE to do that. I don't know how :( Can you point me to a good <br>
> tutorial or explain this a bit and give me some KW to chase down in <br>
> google? <br>
> <br>
<br>
Tony, please think about what you're doing for a moment. <br>
<br>
If you want to call a method or a script XXX inside Zope through a form <br>
where the method expects parameters A and B then you have to write: <br>
<br>
<form action="XXX" method="get|post"> <br>
<br>
<input type="hidden" name="A" tal:attributes="value context/some_method_providing_a" /> <br>
<input type="hidden" name="B" tal:attributes="value context/some_method_providing_b" /> <br>
<br>
Now apply this knowledge to your usecase. Check your _generated_ <br>
code twice if all requirements are fulfilled. <br>
<br>
-aj <br>
<br>
</div>
<!-- end of AOLMsgPart_1_c735e037-7cbd-4a9e-bba4-902a2437fcaa --><div class="AOLPromoFooter">
<hr style="margin-top:10px;" />
AOL now offers free email to everyone. Find out more about what's free from AOL at <a href="http://www.aol.com?ncid=AOLAOF00020000000437" target="_blank"><b>AOL.com</b></a>.<br />
</div>