[Zope] Variable setting in 'if' for use outside of 'if'

Brad Clements bkc@murkworks.com
Wed, 10 Feb 1999 22:02:36 -0400


On 10 Feb 99, at 16:45, Timothy Grant wrote:

> //margin that was selected in index_html
> 
> <FORM ACTION="form_html" METHOD="POST">
>   <table border=1>
>     <!--#in PriceCategories-->
>       <tr>
>         <td>
>           <B><!--#var Category--></B>
>         </td>
>         <td>
>           <select name="<!--#var Category-->" size=1>     //This is all
> much nicer thanks to an earlier 
>             <!--#in "PriceTable(PriceGroup=Category)"-->    //response
>             from
> Amos Thanks!
>               <option><!--#var Description-->                       //The
> fact that it works at all is a testament to
>             <!--#/in-->
>   //Zope's utility, thanks DC.
>           </select>
>         </td>
>       </tr>
>     <!--#/in-->  
>   </table>

    <input type="hidden" name="margin" value="<!--#var margin-->">

>   <input type="submit" name="Calculate" value="Calculate" align="CENTER">
> </FORM>
> 
> form_html:
> <p><b>Margin:</b> <!--#var margin--></p>    //This breaks. Why is "margin"
> undefined when I get here?


Add this to your second form

<input type="hidden" name="margin" value="<!--#var margin-->">

as shown above.



Brad Clements,                bkc@murkworks.com   (315)268-1000
http://www.murkworks.com                          (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com               ICQ: 14856937

We must come down from our heights, and leave our straight 
paths, for the byways and low places of life, if we would 
learn truths by strong contrasts; and in hovels, in forecastles, 
and among our own outcasts in foreign lands, see what has been 
wrought upon our fellow-creatures by accident, hardship, or vice. 
- Richard Henry Dana, Jr. 1836