Check out the SQLFORM in 
HTML<http://web2py.com/books/default/chapter/29/07#SQLFORM-in-HTML>section of 
the book. That's essentially your situation -- you already have 
custom HTML for your form (which you should convert to a web2py view), and 
you just need to handle the processing of the form data in the controller. 
Note, the example in that section of the book has session=None -- this will 
turn off protection against CSRF attacks. Instead of taking that approach, 
I recommend including the following within the form:

{{=form.custom.end}}

as described in the section on Custom 
Forms<http://web2py.com/books/default/chapter/29/07#Custom-forms>. 
That will automatically add both the hidden _formname field and the hidden 
_formkey field (which is used for CSRF protection). If it makes things 
easier, you can also replace some of you HTML field input tags with the 
form.custom.widget elements described in that section.

Anthony

On Tuesday, December 4, 2012 9:44:18 PM UTC-5, Clinton Collins wrote:
>
> I'm a beginner with python and wanted to make an attempt at web-dev. After 
> quite a while of searching I found web2py, but I'm having trouble wrapping 
> my head around a few things it does.
>
> As of right now I have a simple login page designed that has some HTML 
> forms in it already: http://pydev.allgamer.net/panel/default/login
> What would be the best way of recreating the forms with web2py without 
> having to redo the entire source of that page? Forgive my ignorance as I'm 
> doing my best to learn and have searched around for hours and still don't 
> understand how to use form customization to do what I want with it.
>
> Thanks for any feedback.
>

-- 



Reply via email to