In models
db.define_table('list',
Field('name', 'string'),
Field('location', 'string'))
In controller
def list():
form = SQLFORM.factory(
Field('name',label='Name',requires=IS_NOT_EMPTY()),
Field('location',label='Location',requires=IS_NOT_EMPTY()))
In default/list.html
{{=form}}
I want to execute an event onFocus="myFunction()" for field 'location' present in table 'list'.How to do it? Somebody help me.
<script type="text/javascript">
$(document).ready(function () {
$('form:not(.filter) :input:visible:first').focus().select();
</script>