[Zope-DB] Zope: how to execute a sql-method from within a self created form

Matthew T. Kromer matt@zope.com
Thu, 15 Nov 2001 10:14:07 -0500


Hello, Metin,

What you probably want to do is have the form ACTION point to a 
different mechanism, such as one that does

<dtml-call MySQLInsertMethod>
<dtml-call expr="RESPONSE.redirect(URL1+"/MyInsertScreen")>

In that way, you dont have to have the clutter of a page which does both 
form processing and form presentation (ie a page that posts back to itself)

Deniz, Metin wrote:

>Hi everybody,
>
>i have the following problem:
>
>i have created a form and enter some values(vorname, nachname).
>After pressing the submit-button, the sql-method which is being called pops
>up and expects me to enter the values once again. I would rather have the
>method to execute the sql statement right away.
>
>Below are the source code for the form and the sql-methods statement.
>
>sql-method:
>parameters: vorname nachname
>
>INSERT INTO personen
>(vorname, nachname)
>VALUES
>(
><dtml-sqlvar vorname type="string">,
><dtml-sqlvar nachname type="string">
>)
>
>form:
>
><html>
><p>
><form action="testSQL" method="submit">
>Vorname <input name="vorname" width=30 value="bla">
><p>
>Nachname <input name="nachname" width=30 value="tra">
><p>
><input type="SUBMIT" value="Submit Query">
></form>
></html>
>
>
>Thank you very much in advance.
>
>
>Metin Deniz
>
>_______________________________________________
>Zope-DB mailing list
>Zope-DB@zope.org
>http://lists.zope.org/mailman/listinfo/zope-db
>