Crud forms can be manipulated server side like any other HTML helper, as 
explained at 
http://web2py.com/book/default/chapter/05#Server-side-DOM-and-Parsing and 
http://www.web2pyslices.com/main/slices/take_slice/43. There may be an 
easier way, but one way to add an id to a crud form would be:
 
    form=crud.create(db.mytable)
    form.element('form')['_id'] = 'myform'
 
Anthony

On Monday, April 11, 2011 8:40:13 AM UTC-4, luifran wrote:

> I want it to affect all the forms, I use crud forms, how I can put a 
> id for the crud forms? 
>
> On 11 abr, 00:38, pbreit <[email protected]> wrote: 
> > Possibly because you are binding to 'form'. You might want to make the 
> bind 
> > more specific like this: 
> > 
> > <form id=myform action=/home> 
> > <input name=a> 
> > <input type=submit> 
> > </form> 
> > <script> 
> > $(function() { 
> >    $('myform').bind('keypress', function(event) { 
> >      if (event.keyCode == 13) { 
> >        $('form').submit() 
> >      } 
> >    }); 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > });

Reply via email to