<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.0.10">
</HEAD>
<BODY>
<BR>
Hi,<BR>
<BR>
I think that I already made this kind of thing working with a simple :<BR>
<BR>
<PRE> <dtml-in "findResults(REQUEST.form)">
...
</dtml-in>
</PRE>
(if "findResults" is the name of your ZSQLMethod component...)<BR>
<BR>
<BR>
Thierry<BR>
<BR>
<BR>
<BR>
On Tue, 2004-10-19 at 18:11, Laura McCord wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE><FONT COLOR="#40a3c5"><I>Ok. I redesigned my zsql method to be much simpler:
select * from host
<dtml-sqlgroup where>
<dtml-sqltest name="location1" column="site" type="nb" optional>
<dtml-or>
<dtml-sqltest name="location2" column="site" type="nb" optional>
<dtml-or>
<dtml-sqltest name="location3" column="site" type="nb" optional>
<dtml-and>
<dtml-sqlgroup>
<dtml-sqltest name="usetype1" column="UseType" type="nb" optional>
<dtml-or>
<dtml-sqltest name="usetype2" column="UseType" type="nb" optional>
<dtml-or>
<dtml-sqltest name="usetype3" column="UseType" type="nb" optional>
</dtml-sqlgroup>
<dtml-and>
<dtml-sqltest name="active" column="Active_Inactive" type="int"
optional>
</dtml-sqlgroup>
My form is a combination of checkboxes:
<form action="resultsPage">
<table>
<tr>
<td>Select any of the following combinations:</td>
</tr>
</table>
<table>
<tr>
<td>Active:</td>
<td><input type="checkbox" name="active" value="1"
checked="checked">Active</td>
</tr>
<tr>
<td>Site:</td>
<td><input type="checkbox" name="location1" value="aus">Austin </td>
<td><input type="checkbox" name="location2"
value="ca">California</td>
<td><input type="checkbox" name="location3"
value="mass">Massachusetts</td>
</tr>
<tr>
<td>UseType:</td>
<td><input type="checkbox" name="usetype1"
value="server">Server</td>
<td><input type="checkbox" name="usetype2" value="cad"> CAD</td>
<td><input type="checkbox" name="usetype3" value="base">Base</td>
</tr>
<tr>
<td><span><input type="submit" class="submitLink"
value="save"></span></td>
</tr>
</table>
</form>
The only problem I am having is bridging the two in order to get my
results. I have a dtml method that I am trying to process the zsql
method but I don't think I am doing it correctly.
<dtml-call expr="findResults(location1=location1, ...,
usetype1=usetype1, ...,active=active)">
But, with the above if location2 or any of the boxes are not selected I
am getting an error that they are not defined. How do I correct this
problem?
Thanks You.
_______________________________________________
Zope maillist - Zope@zope.org</FONT>
<A HREF="http://mail.zope.org/mailman/listinfo/zope"><U>http://mail.zope.org/mailman/listinfo/zope</U></A>
<FONT COLOR="#40a3c5">** No cross posts or HTML encoding! **
(Related lists -
</FONT><A HREF="http://mail.zope.org/mailman/listinfo/zope-announce"><U>http://mail.zope.org/mailman/listinfo/zope-announce</U></A>
<FONT COLOR="#40a3c5"> </FONT><A HREF="http://mail.zope.org/mailman/listinfo/zope-dev"><U>http://mail.zope.org/mailman/listinfo/zope-dev</U></A><FONT COLOR="#40a3c5"> )</I></FONT></PRE>
</BLOCKQUOTE>
</BODY>
</HTML>