Hi!!!
I commented that you can solve the problem by doing the following:
1°) Modifying the function as follows
def fgetlocalidad():
idprovincia = 0
result=''
idprovincia = int(request.vars.idprovincia)
localidad_rows =
db(db.trlocalidad.idprovincia==idprovincia).select(orderby=db.trlocalidad.localidad_cp)
result = '<td><label class="control-label col-sm-3"
id="label_localidad">Localidad:</label> '
result += '<select class="idlocalidad" id="idlocalidad"
name="idlocalidad"> '
for item in localidad_rows:
result += '<option value=' + str(item.id) + '>' + item.localidad_cp
+ '</option>'
result += '</select></td>'
return XML(result)
2°) In the function def abmpersona():
define the url like this:
url=URL(c='persona',f='fgetlocalidad')
Modify the line where you call the function like this:
TR(TD( (LABEL("Provincia:",_class='control-label
col-sm-3',_id='label_provincia'),
SELECT(_id="idprovincia",_class="idprovincia",_name="idprovincia",*[OPTION(i['descripcion'],
_value=str(i['id'])) for i in
provincia_row])),_onchange="ajax('%s' , ['idprovincia'], 'ciudad');" %
url)),
Regards.
--
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.