Hi;<br>
I originally submitted this to the Zope list, but after no replies and realizing it's probably better suited for the python list, I'm submitting it here.<br>
<br>
<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: <A href="http://example.com/s/c/x/j/en-us/s/renumberTheCart%28here" target=_blank>http://example.com/s/c/x/j/en-us/s/renumberTheCart%28here</A><br>
</FONT><br>
meaning, of course, that it didn't receive the required parameter.<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></div>
<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>