<form method="get" action="formulator/delobjects"><br> <span tal:repeat="id container/objectIds"> <INPUT TYPE="checkbox" name="id"> <p tal:replace="id"></p><br> </span> <INPUT TYPE="SUBMIT" name="manage_delObjects" VALUE="Delete"> </form> The above code will list checkbox and corresponding objectIds example checkbox obj1 checkbox obj2 checkbox obj3 ...... ...... DELETE BUTTON I am passing the form ObjectIds to page template code shown below <div tal:condition="python: request.submit == 'Delete'"> <h2><span tal:replace="request/id">Id</span> Deleted</h2> <span tal:condition="python: manage_delObjects(request.id)"> Delete </span> </div> Now when i select the checkbox & click on DELETE BUTTON obj1 should get deleted.same thing follows for other objects.Please suggest me what changes should i make in the above code to get the output.Pleas send me the reply as early as possible. __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com
mohammed ismail wrote:
<form method="get" action="formulator/delobjects"><br>
Your action attribute is somewhat dubious. I'd make it a full URL if I were you...
<span tal:repeat="id container/objectIds"> <INPUT TYPE="checkbox" name="id">
I'd change that name to "ids:list", so you always end up with a REQUEST variable called ids that is a list of strings ids of objects to delete.
<p tal:replace="id"></p><br>
</span> <INPUT TYPE="SUBMIT" name="manage_delObjects" VALUE="Delete"> </form>
Don't give your <input> tag a name like that, it's not clever...
<div tal:condition="python: request.submit == 'Delete'"> <h2><span tal:replace="request/id">Id</span> Deleted</h2> <span tal:condition="python: manage_delObjects(request.id)"> Delete </span> </div>
This is truly truly evil. This should all be in a python script. DON'T put logic in ZPT.
Now when i select the checkbox & click on DELETE BUTTON obj1 should get deleted.same thing follows for other objects.Please suggest me what changes should i make in the above code to get the output.Pleas send me the reply as early as possible.
You need to brush up on your list etiquette. You're not paying us (yet ;-) so demanding a reply ASAP and using a silly subject line will not get you help. Suggest you go and read a bit more of the Zope Book on zope.org, have a look at a few more examples, and then come back and start asking questions about specific problems rather than dumping a load of half formed code in an email and expecting others to do your work for you ;-) Chris
participants (2)
-
Chris Withers -
mohammed ismail