[Tutor] html and mod_python

Patty patriciap.gu at gmail.com
Mon Mar 27 19:40:12 CEST 2006


Hi,

Can you please give me a quick example of how to do this:

>  Then change printbox() to create the 
> tag using a loop over the value. For each value, check to see if it is 
> the same as the value passed in and generate the appropriate option tag.
 

The way i have it right now is:


        tag = """
        <select name='percent'>
        <option SELECTED VALUE=%s>%s</option>
        <option VALUE='-'>-</option>
        <option VALUE='0'>0%%</option>
        <option VALUE='10'>10%%</option>
        <option VALUE='20'>20%%</option>
        <option VALUE='30'>30%%</option>
        <option VALUE='40'>40%%</option>
        <option VALUE='50'>50%%</option>
        <option VALUE='60'>60%%</option>
        <option VALUE='70'>70%%</option>
        <option VALUE='80'>80%%</option>
        <option VALUE='90'>90%%</option>
        <option VALUE='100'>100%%</option>
        </select>""" % (selected_value, selected_value)

Although it does what i want, I don't like the way the value is display.

Thanks,
Patty



More information about the Tutor mailing list