On Tuesday, January 3, 2017 at 1:35:51 AM UTC-8, Dave S wrote:
>
> 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?
>

Ah, I found that I needed to strip the "__label" ; I had drilled in 
not-carefully-enough when using inspect-element in the browser.


> 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.
>
> [There's a second question, but I think I can handle it by defining a 
> custom validator.  I may want to have equivalent validation on the browser 
> side, though, so I may be back with Q2 later.]
>
>
And this one was covered by "IS_MATCH", because the input was to be 
arbitrary combinations of 'x', 'd', and 'p' used as a string.
 

> Thanks.
>
> /dps
>

For the record.
 

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