On Sunday, September 18, 2011 4:05:17 AM UTC-4, JavierQQ wrote: > > > Thanks it worked, but can it change the submit_button='' too? > is there a way to change it to > <button id="create-user">Create new user</button> >
web2py forms use <input type="submit' value="[submit_button]">, not the <button> tag. You can change the label displayed on the button via the submit_button argument to SQLFORM. I'm not sure if the API provides a way to add an id to the submit element, but you can do it using the server-side DOM (http://web2py.com/book/default/chapter/05#Server-side-DOM-and-Parsing), as follows: form.element('input', _type='submit')['_id'] = 'create-user' That's saying to find an 'input' element in the form object that has _type='submit', and then add a new attribute, '_id', with the value 'create-user'. Anthony

