It's working !!! when it's loaded:
<https://lh6.googleusercontent.com/-JSEHs-9y3_s/TnpFeHkX1oI/AAAAAAAAAEk/_v9qypV6g6E/s400/Capture1.JPG> After the item changed: <https://lh6.googleusercontent.com/-uZWUWSnxT84/TnpFqggp3EI/AAAAAAAAAEo/1IDya_nZcOI/s400/Capture2.JPG> After Submit: <https://lh4.googleusercontent.com/-9NMQ3qKH3pM/TnpFxsHPCfI/AAAAAAAAAEs/pCfsC2Nki4U/s400/Capture3.JPG> Now, I have two minor problems. 1. Second list will be gone after Submit 2. Second list doesn't show when it's loaded I'm thinking if we can show the original "<select name='model_name' ..." and hide it when the item is changed so that one it view and one generated from xml will be switching behind the seen. But not sure how to do or if there is better way. default/index.html ---------------------------- <form enctype="multipart/form-data" action="{{URL()}}" method="post"> <select name='category_name' onchange="ajax('model', ['category_name'], 'target')"> {{for category in categories:}} <option value="{{=category.id}}" {{=" selected='selected'" if str(category.id)==request.vars.category_name else ""}}> {{=category.Name}} </option> {{pass}} </select> <div id='target'></div> <input type="submit" value='Submit'> <!--<select name='model_name' > {{for model in models:}} <option value="{{=model.id}}" {{=" selected='selected'" if str(model.id)==request.vars.model_name else ""}}> {{=model.Name}}</option> {{pass}} </select>--> </form> controllers/default.py ---------------------------------- def index(): if request.vars.model_name: lists = db(db.Product.Model_ID==request.vars.model_name).select(db.Product.ALL) themodels = db(db.Model.id==request.vars.model_name).select(db.Model.ALL) else: lists = db(db.Product.Model_ID==1).select(db.Product.ALL) themodels = db(db.Model.id==1).select(db.Model.ALL) categories = db().select(db.Category.ALL) if request.vars.category_name: models = db(db.Model.Category_ID==request.vars.category_name).select(db.Model.ALL) else: models = db(db.Model.Category_ID==1).select(db.Model.ALL) return dict(lists=lists, categories=categories, models=models, themodels=themodels) def model(): models = db(db.Model.Category_ID==request.vars.category_name).select(db.Model.ALL) result = "<select name='model_name'>" for model in models: result += "<option value='" + str(model.id) + "'>" + model.Name + "</option>" result += "</select>" return XML(result)