I am using web2py forms and i want to have some fields only visible to user (as fixed which cannot be edited). I tried making various combinations of editable, writeable, readonly but was of no use. I looked into web2py book too but that also seems insufficient. It would be great if someone can tell me how to do this.
相关问题
- Laravel Option Select - Default Issue
- HTML form is not sending $_POST values
- How to use Control.FromHandle?
- C# how to invoke a field initializer using reflect
- Xamarin. The name 'authorEntry does not exist
相关文章
- Show a different value from an input that what wil
- How can I detect/watch “dirty-status” of an angula
- Factor Clojure code setting many different fields
- Why form submit opens new window/tab?
- Setting Angular 2 FormArray value in ReactiveForm?
- Rails: Using form fields that are unassociated wit
- How to get the “value” of a FilteringSelect <se
- Django 'ManagementForm data is missing or has
You mean some fields visible to all visitors and some fields visible only if logged in?
If that's the case, then build your form conditionally:
Unless you're not talking about logged in users, and just want to make the fields be visible, but not editable. Then, use writable=False like you tried, but I think you have to either use crud.create/crud.update or SQLFORM / SQLFORM.factory (the latter does not require a data model)
If you the form is based off of a database, you can use CRUD (you'll need to modify the settings for CRUD if you're not using authentication, so that CRUD forms are accessible)
or