I have an SQLFORM where I wanted the value of field 3 to depend on the 
value of field 2, sort of like cascading autocompletes, but not quite. 
 Field 3 was going to be populated with the length of the string in Field 
2, so I tried adding to my view

<script>
jQuery(document).ready(function(){
   jQuery(''#QM_Len__label'').click(function(){jQuery('#QM_Len__label').val(
jQuery("#QM_Mint__label").length)});
});
</script>

This didn't seem to do anything.  Obviously I wasn't completely 
understanding the autocomplete example in Chapter 11, nor other posts in 
this forum.  What was I missing?  Also, I should be able to use 
jQuery.focus() in place of jQuery.click(), yes?

Note:  For this specific issue, I have found that making Field 3 a computed 
field in my qm-db.py definitions works quite well, but I think I may run 
into other situations where having the answer to this will make those 
easier to handle.

Thanks.

/dps


-- 
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.

Reply via email to