Why don't you use elif? On Wed, Oct 29, 2014 at 6:23 PM, Sriram Gudimella < sriramsgudime...@gmail.com> wrote:
> Why does this ...... > <table> > {{for i in range(0,3):}} > <tr> > {{if i==0:}} > <td> > Email : > </td> > <td> > {{=form[i]}} > </td> > <br/> > </tr> > {{else if i==1:}} > <tr> > <td> > Passkey : > </td> > <td> > {{=form[1]}} > </td> > </tr> > {{else :}} > <tr> > <td> > </td> > <td> > {{=form[2]}} > </td> > </tr> > {{pass}} > {{pass}} > </table> > translate to > > for i in range(0,3): > response > <http://127.0.0.1:8000/examples/global/vars/response>.write('\n\t<tr>\n\t', > escape=False) > if i==0: > response > <http://127.0.0.1:8000/examples/global/vars/response>.write('\n\t\t<td>\n\t\tEmail > :\n\t\t</td>\n\t\t<td>\n\t\t', escape=False) > response > <http://127.0.0.1:8000/examples/global/vars/response>.write(form[i]) > response > <http://127.0.0.1:8000/examples/global/vars/response>.write('\n\t\t</td>\n\t\t<br/>\n\t</tr>\n\t', > escape=False) > else if i==1: > response > <http://127.0.0.1:8000/examples/global/vars/response>.write('\n\t<tr>\n\t\t<td>\n\t\tPasskey > :\n\t\t</td>\n\t\t<td>\n\t\t', escape=False) > response > <http://127.0.0.1:8000/examples/global/vars/response>.write(form[1]) > response > <http://127.0.0.1:8000/examples/global/vars/response>.write('\n\t\t</td>\n\t</tr>\n\t', > escape=False) > else : > response > <http://127.0.0.1:8000/examples/global/vars/response>.write('\n\t<tr>\n\t\t<td>\n\t\t</td>\n\t\t<td>\n\t\t', > escape=False) > response > <http://127.0.0.1:8000/examples/global/vars/response>.write(form[2]) > response > <http://127.0.0.1:8000/examples/global/vars/response>.write('\n\t\t</td>\n\t</tr>\n\t', > escape=False) > pass > response > <http://127.0.0.1:8000/examples/global/vars/response>.write('\n\t', > escape=False) > pass > > > -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Report Issues) > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.