Guys!!

I need help!!
How can I use "MODAL" to edit a value??

Follow my code:

-----controller:
def table_ufs():
    form = SQLFORM(db.uf)
    if form.process().accepted:
        session.flash = 'REGISTRATION SAVED SUCCESSFULLY'
        redirect(URL('table_ufs'))
    elif form.errors:
        response.flash = 'THERE ARE ERROS IN THE FORM. PLEASE TRY AGAIN'

    results = db(db.uf).select(orderby=db.uf.id)
    return locals()

def update_uf():
    form = SQLFORM(db.uf, request.args(0, cast=int))
    if form.process().accepted:
        session.flash = 'Updated Record'
        #redirect(URL('table_ufs'))
    elif form.errors:
        response.flash =  'THERE ARE ERROS IN THE FORM. PLEASE TRY AGAIN'
    return locals()

---------------view:

{{for row in results:}}
                    <tr>
                        <td>{{=row.id}}</td>
                        <td>{{=row.uf_name}}</td>
                        <td>{{=row.actived}}</td>
                        <td >
                            <a class="modal-trigger" id="update" 
href="{{=URL(f='update_uf',args=[uf.id]}}" title="update" style="    
position: absolute; margin: -19px 37px;font-size: 26px;"><i 
class="mdi-editor-mode-edit" style="color: #000;"></i></a>

                            <a id="delete" href="{{=URL('delete_uf', 
args=row.id)}}" title="delete" style="    position: absolute; margin: -19px 
68px;font-size: 26px;"><i class="mdi-navigation-cancel" style="color: 
red;"></i></a>
                        </td>
                    </tr>
                {{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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to