It seems Jim had the most simple solution: <form action="/" name="main" method="post"> $if not form.valid: <p class="error">Probeer opnieuw:</p> <table border=0px> <td align="left" valign="top">$:form.render()</td> <td align="left" valign="top"> <input type="submit" value="Zoeken" /> </td> </table> </form>
does the trick! I don't need POST method in the separate classes and all search results are shown on the index page. This is what I was looking for. Many thanks! Mark On Aug 25, 12:46 pm, digistam <digis...@gmail.com> wrote: > I'll try this, thanks! > > Jim schreef: > > > > > > > > > I do this but I do not use Web.py Forms. I would just set the action > > url > > of my html forms to point at /index, this way you do not need any post > > methods for your other pages. > > >http://www.w3schools.com/tags/att_form_action.asp > > > If you can work out how to set the action on your Web.py form, you > > could > > do the same I think. > > > Jim > > > On Aug 25, 8:29 am, digistam <digis...@gmail.com> wrote: > > > In my web.py project I have about 5 pages. All pages contain a > > > standard search form. At the moment, each of the 5 pages has it's own > > > class with always the same POST action: > > > > def POST(self): > > > form = myform() > > > if not form.validates(): > > > session.pages = 'none' > > > return render.index(session.pages,form) > > > else: > > > index().POST() > > > > return render.index(session.pages,form) > > > > As you can see, the search form always does the same trick (just doing > > > what's in the INDEX POST action). I'm sure this is not the best > > > solution. I really would like to display the results on the index page > > > and at the moment it's not. Now it's working like this: > > > >http://localhost:8080/page1-> search form action -> results are > > > displayed onhttp://localhost:8080/page1 > > > >http://localhost:8080/page2-> search form action -> results are > > > displayed onhttp://localhost:8080/page2 > > > > etc. > > > > This is not what I want, I want to have it like this: > > > >http://localhost:8080/page1-> search form action -> results are > > > displayed onhttp://localhost:8080/index > > > >http://localhost:8080/page2-> search form action -> results are > > > displayed onhttp://localhost:8080/index > > > > etc. > > > > I hope that I can explain this problem well enough. What's the > > > solution to this ? > > > > Thanks in advance, > > > > Mark -- You received this message because you are subscribed to the Google Groups "web.py" group. To post to this group, send email to webpy@googlegroups.com. To unsubscribe from this group, send email to webpy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/webpy?hl=en.