Passing parameters to an SQL_method
Hi, Newbie. Zope 2.3.2 on Win98. I want to pass some parameters from a web form to a Zsql method to update a record. I try the following dtml method : <br><table> <tr><th>Code:</th> <td><input code="code" width=30 value="<dtml-var code>"> <tr><th>Name :</th> <td><input name="name" width=30 value="<dtml-var name>"> <tr><th>Cognome :</th> <td><input name="surname" width=30 value="<dtml-var surname>"> </td></tr> </table> <br> <form action="sql_update(name, code)" method="POST"> <input type="submit" value=" UPDATE "><br> But I get the following error : Site Error An error was encountered while publishing this resource. Debugging Notice Zope has encountered a problem publishing your object. Cannot locate object at: http://localhost:8080/zoo/Database/sql_update%28name,%20code%29 ---------------------------------------------------------------------------- ---- Troubleshooting Suggestions The URL may be incorrect. The parameters passed to this resource may be incorrect. A resource that this resource relies on may be encountering an error. For more detailed information about the error, please refer to the HTML source for this page. If the error persists please contact the site maintainer. Thank you for your patience. Traceback (innermost last): File C:\Programmi\WebSite\lib\python\ZPublisher\Publish.py, line 223, in publish_module File C:\Programmi\WebSite\lib\python\ZPublisher\Publish.py, line 187, in publish File C:\Programmi\WebSite\lib\python\Zope\__init__.py, line 221, in zpublisher_exception_hook (Object: Traversable) File C:\Programmi\WebSite\lib\python\ZPublisher\Publish.py, line 162, in publish File C:\Programmi\WebSite\lib\python\ZPublisher\BaseRequest.py, line 369, in traverse File C:\Programmi\WebSite\lib\python\ZPublisher\HTTPResponse.py, line 557, in debugError NotFound: (see above) Any help would be appreciated. Thanks in advance Fabrizio
Try: <form action="sql_update" method="POST"> <br><table> <tr><th>Code:</th> <td><input code="code" width=30 value="<dtml-var code>"> <tr><th>Name :</th> <td><input name="name" width=30 value="<dtml-var name>"> <tr><th>Cognome :</th> <td><input name="surname" width=30 value="<dtml-var surname>"> </td></tr> </table> <br> <input type="submit" value=" UPDATE "><br> </form> -steve On Friday, August 3, 2001, at 12:15 PM, Fabrizio wrote:
<br><table>
<tr><th>Code:</th> <td><input code="code" width=30 value="<dtml-var code>"> <tr><th>Name :</th> <td><input name="name" width=30 value="<dtml-var name>"> <tr><th>Cognome :</th> <td><input name="surname" width=30 value="<dtml-var surname>">
</td></tr> </table>
<br>
<form action="sql_update(name, code)" method="POST"> <input type="submit" value=" UPDATE "><br>
Thanks for your help, but it doesn't work. It calls my "sql_update" Zsql method, but it fails to pass parametres ("name" and "code") to it, which is what I want to do. I also tried the following : <form action="sql_update(name, code)" method="POST"> But this does not seem the correct way to pass parameters. Any further help ? Thanks in advance. Fabrizio.
Try:
<form action="sql_update" method="POST"> <br><table> <tr><th>Code:</th> <td><input code="code" width=30 value="<dtml-var code>"> <tr><th>Name :</th> <td><input name="name" width=30 value="<dtml-var name>"> <tr><th>Cognome :</th> <td><input name="surname" width=30 value="<dtml-var surname>">
</td></tr> </table>
<br> <input type="submit" value=" UPDATE "><br> </form>
-steve
Ack.. I didn't see this before in your HTML: You have code="code", it needs to be name="code" -steve <form action="sql_update" method="POST"> <br><table> <tr><th>Code:</th> <td><input name="code" width=30 value="<dtml-var code>"> <tr><th>Name :</th> <td><input name="name" width=30 value="<dtml-var name>"> <tr><th>Cognome :</th> <td><input name="surname" width=30 value="<dtml-var surname>"> </td></tr> </table> <br> <input type="submit" value=" UPDATE "><br> </form> On Saturday, August 4, 2001, at 10:23 AM, Fabrizio wrote:
Thanks for your help, but it doesn't work.
It calls my "sql_update" Zsql method, but it fails to pass parametres ("name" and "code") to it, which is what I want to do.
I also tried the following :
<form action="sql_update(name, code)" method="POST">
But this does not seem the correct way to pass parameters.
Any further help ?
Thanks in advance.
Fabrizio.
Try:
<form action="sql_update" method="POST"> <br><table> <tr><th>Code:</th> <td><input code="code" width=30 value="<dtml-var code>"> <tr><th>Name :</th> <td><input name="name" width=30 value="<dtml-var name>"> <tr><th>Cognome :</th> <td><input name="surname" width=30 value="<dtml-var surname>">
</td></tr> </table>
<br> <input type="submit" value=" UPDATE "><br> </form>
-steve
participants (2)
-
Fabrizio -
Steve Spicklemire