1.-
I just want to test this code, but it doesn't run very well, it
doesn't show execute the ajax function. Do i need something to run
ajax code?, this code is taken from web2py manual.

----Model
db=SQLDB('sqlite://db.db')
db.define_table('taxpayer',
    SQLField('name'),
    SQLField('married','boolean'),
    SQLField('spouse_name'))


----Controller
def index():
    form=SQLFORM(db.taxpayer)
    if form.accepts(request.vars,session):
        response.flash='record inserted'
    return dict(form=form)



---View
{{extend 'layout.html'}}
{{=form}}
<script>
$(document).ready(function(){
    $('#taxpayer_spouse_name__row').hide();
    $('#taxpayer_married').attr('onchange',
        "if($('#taxpayer_married').attr('checked'))
            $('#taxpayer_spouse_name__row').show();
        else $('#taxpayer_spouse_name__row').hide();");
});
</script>

2.- In the view, how can i reference to text box created by form like
this in the script.

form=FORM(TABLE(
    #TR("Lluvia", INPUT(_type="checkbox",_name="lluvia",
_checked=False)) ,
    TR("Tipo de reporte:",SELECT(_name="tipo",requires=IS_IN_SET
(reportes),*reportes)),
    TR("Usuario",SELECT(_type="select",_name="usuario",
        *[OPTION(x.apellidopaterno,' ',x.apellidomaterno,'
',x.nombre,_value=x.id)
        for x in db().select(db.usuario.ALL, orderby =
db.usuario.apellidopaterno)])),
    TR("Fecha Inicio", INPUT
(_name="datelimite1",_class='datetime',_id="datetlimite1")),
    TR("Fecha Final", INPUT
(_name="datelimite2",_class='datetime',_id="datetlimite2")),
    TR("", INPUT(_type='submit',_value='Reporte'))
        ))


Thanks in advance.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to