[Zope] How do I call a parameter from inside of the same form?

Peter Bengtsson peter@grenna.net
Wed, 5 Jul 2000 16:53:39 +0100


I can only help you with this if the select thing is multiple.

<__untested but should work__>

<dtml-call "REQUEST.set('SQLstmt','SELECT * FROM dbtable WHERE')">
<dtml-in where_statement>
    <dtml-let sequence_item=sequence-item>
        <dtml-call "REQUEST.set('SQLstmt',SQLstmt+sequence_item)">
        <dtml-unless sequence-end>
            <dtml-call "REQUEST.set('SQLstmt',SQLstmt+' AND ')">
        </dtml-unless>
</dtml-let>
</dtml-in>

----- Original Message ----- 
From: Sean G Richards <sean@sharpwebinnovations.com>
To: <zope@zope.org>
Sent: Wednesday, July 05, 2000 3:59 PM
Subject: [Zope] How do I call a parameter from inside of the same form?


> Hello,
>     I am trying to build an SQL statement in a form, and then pass the
> statement onto a Z SQL method, for execution.
> something like
> 
> < form action="search_results" method="get">
> 
> <input type="text" name="select_statement" value="SELECT  name,
> phone_number, address FROM black_book WHERE" size=20>
> 
> <select  name="where_statement" size=3>
>    <option value=" name = 'jennifer' ">Jennifer
>    <option value=" name='anne' " > Anne
>    <option value=" name='alice' ">Alice
> </select>
> 
> <input type="hidden" name="cat_both_previous_statements"
> value="<dtml-sqlvar select_statement type=string> <dtml-sqlvar
> where_statement type=string>">
> 
> <input type="SUBMIT" name="SUBMIT" value="SUBMIT">
> </form>
> 
>     I understand that this isn't the correct way to do this, I am just
> trying to convey what I want to do, and maybe someone can help me!
> Also, what would I do if the <select> box was multiple, where I could
> select more than one option?  Well, if this is possible in Zope please
> let me know.
> Thank you and have a nice day!
> 
>     Sean Richards
> 
> 
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )
>